Reimage Your Server for LAMP Stack Installation
LAMP Stack is a web hosting environment that combines Linux, Apache, MySQL, and PHP to support websites and web applications. If you need to start fresh or resolve issues with your LAMP Stack installation, you can reimage the application on your Self-Managed VPS. This article explains how to reimage LAMP Stack and restore it to a clean installation.
This guide walks you through installing and setting up LAMP Stack in your HostGator Customer Portal.
How to Reimage Your Server for LAMP Stack Installation
- You can install only one application using the one-click installer.
- To change or delete your application, follow the guide: How to Change an Application. Create a backup of your existing applications or templates.
- To keep your current template, install the new application manually using SSH instead of reimaging.
- If you do reimage, the system automatically selects the recommended operating system for LAMP Stack.
- Log in to your Customer Portal.
- From the left-hand menu, navigate to Hosting and select My Plans.

- Click Manage next to the hosting package you wish to reimage.

- In the Overview tab, click the Reimage button on the right side of the Server Image section.

- Go to the Applications tab.

- Locate LAMP Stack from the list and click Select.

- Type reimage into the field to confirm, then click Proceed.

- Allow a few minutes for the installation to finish.

- When finished, LAMP Stack will appear under the Server Image section.

How to Verify Your LAMP Stack is Running in Docker
Note: When you provision your server with the LAMP Stack application, Docker is automatically installed and configured for you. The entire LAMP stack (Apache, MySQL, and PHP) runs inside isolated Docker containers to strengthen security and to simplify management.
Use the steps below to confirm your LAMP Stack is up and running.
Step 1: Reset Your Root Password
Before you begin, set your root password so you can log into your server.
- Log in to your Customer Portal.
- From the left-hand menu, navigate to Hosting and select My Plans.

- Locate the server you want to manage, then click View Details in the bottom-left corner to expand the section and access additional server information.

- Click the Reset Password button.

- In the pop-up window, type your new root password, then click Reset Password again to confirm and save the changes.

Step 2: Log in to Your Terminal
- Connect to your VPS via SSH.
Use your VPS IP address and credentials with an SSH client:Replaceyour_server_ipwith your actual server IP address.ssh root@your_server_ip - Check if the LAMP Docker containers are running:
docker ps
You should see containers with images such as
php:apache(web/PHP),mysql:latest(database), and possiblytraefik:latest(proxy). - Verify that Apache is serving content:
ReplaceIn your browser, visit
your_server_ipwith your actual server IP address.http://your_server_ip/. If you see the message "It works!", Apache inside Docker is running and accessible. - Confirm PHP is working:
echo '<?php phpinfo(); ?>' > /tmp/info.php docker cp /tmp/info.php $(docker ps -qf "ancestor=php:apache"):/var/www/html/info.php
-
In your browser, go to
http://your_server_ip/info.php. You should see the PHP Information page, which confirms PHP is installed and functioning. -
For security, remove the test file afterwards:
docker exec $(docker ps -qf "ancestor=php:apache") rm /var/www/html/info.php
-