Loading...

Knowledge Base

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

  1. Log in to your Customer Portal.
  2. From the left-hand menu, navigate to Hosting and select My Plans.

    Customer Portal - Hosting tab - View Details
     

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

    Self-Managed VPS - Select Server - Manage
     

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

    Self-Managed VPS - Manage Server Overview - Reimage Button
     

  3. Go to the Applications tab.

    Self-Managed VPS - Manage Server Overview - Install Application
     

  4. Locate LAMP Stack from the list and click Select.

    Self-Managed VPS - Install LAMP Stack
     

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

    Self-Managed VPS - Install LAMP Stack
     

  6. Allow a few minutes for the installation to finish.

    Self-Managed VPS - Reimage in Progress
     

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

    Self-Managed VPS - Install LAMP Stack
     

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.

  1. Log in to your Customer Portal.
  2. From the left-hand menu, navigate to Hosting and select My Plans.

    Customer Portal - Hosting tab - View Details
     

  3. 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.

    Customer Portal - Hosting tab - View Details
     

  4. Click the Reset Password button.

    Customer Portal - Hosting tab - View Details - Reset Password
     

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

    Customer Portal - Hosting tab - View Details - Reset Password
     

Step 2: Log in to Your Terminal

  1. Connect to your VPS via SSH.
    Use your VPS IP address and credentials with an SSH client:
    ssh root@your_server_ip
  2. 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 possibly traefik:latest (proxy).

  3. Verify that Apache is serving content: In your browser, visit http://your_server_ip/. If you see the message "It works!", Apache inside Docker is running and accessible.
  4. 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

Loading...