Reimage Your Server for Moodle Installation
Moodle pairs solid security with a complete toolkit for building an online learning environment tailored to your needs. It holds up just as well for a single classroom as it does for a company-wide training rollout, growing or shrinking to fit the job.
This guide walks you through installing and setting up Moodle in your HostGator Customer Portal.
How to Reimage Your Server for Moodle Installation
Follow the steps below to reimage your server and get Moodle running.
- 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.
- To keep your current template, install the new application manually using SSH instead of reimaging.
- If you reimage, the system automatically selects the recommended operating system for Moodle.
- Before choosing an application to reimage your server, make sure your hosting plan meets its minimum system requirements to prevent installation issues.
- 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 Moodle in the list and click Select.

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

- Allow time for the installation to finish. This usually takes a few minutes but can take longer depending on the application.

- When finished, Moodle will appear in the Server Image section.

Preparing Your HostGator VPS for Moodle
Work through these steps to finish your initial setup.
Step 1: Log In to 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: Retrieve Initial Admin Credentials
Your Moodle server generates secure credentials automatically during installation, and stores them locally for you to retrieve.
- Connect to your VPS via SSH.
Open a terminal (or an SSH client like PuTTY) and log in as the administrator using your server's public IP address. Replace
your_server_ipwith your actual server IP address.ssh root@your_server_ipFollow the prompts and enter the new root password you set in the step above.
- Once you're logged in, the server greets you with a welcome message that includes:
- The Moodle administrator username (
admin) - The Moodle login URL
- Where your generated passwords are stored (
/root/.app_passwords)
Example Output:
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 6.8.0-111-generic x86_64) ******************************************************************************** The UFW firewall is enabled. All ports are BLOCKED except 22 (SSH), 80 (HTTP), and 443 (HTTPS). You can access Moodle at: https://12.3.456.789/login/index.php User: admin Password is saved in /root/.app_passwords To change your site to load under a domain instead of an ip, on the server run: /root/domain-change For more details please see /root/README.md ******************************************************************************** To delete this message of the day: rm -rf /etc/update-motd.d/99-moodle - The Moodle administrator username (
Step 3: Open the Moodle Management Interface
With your administrator credentials in hand, you're ready to open the Moodle dashboard.
- Open a web browser and go to the Moodle URL from your server's welcome message: https://your-server-ip/login/index.php
ReplaceExample:
your_server_ipwith your actual server IP address.
https://12.3.456.789/login/index.php - On the login screen, enter:
- Username: admin
- Password: The value of moodle_admin_pass from
cat /root/.app_passwords
- Click Log in.

Step 4: Update the System Password
Moodle makes you swap out that temporary password the first time you log in, as a security measure.
- Enter your current password.
- Create a new administrator password.
- Confirm the new password.
Your new password must include:
- At least 8 characters
- One uppercase letter
- One lowercase letter
- One number
- One special character (such as *, #, or -)
- Click Save changes.

Step 5: Complete Your Profile Setup
Once your password's updated, Moodle asks you to fill in your account details.
- Fill in the required fields, including:
- First Name
- Last Name
- Email Address
- Scroll to the bottom of the page, then click Update profile.

You'll see a confirmation message once your profile updates successfully.
What's Next: Point a Domain to Your Site
Out of the box, Moodle answers to your server's public IP address.
Ready to switch over to your own domain name? Connect to your server over SSH and run:
Follow the prompts to point Moodle's configuration at your domain. Once it's done, your custom domain replaces the server IP for accessing your learning platform.
Why a Domain Name is Important
- Security: A domain lets you get a free SSL certificate, which clears the "Not Secure" browser warning and encrypts login data.
- User Experience: A web address (like learning.yourcompany.com) is far easier to remember and share than an IP address (like 50.6.230.166).
- Email Reliability: Stick with just an IP address, and Moodle's automated emails (like password resets) will likely get blocked or land in spam with providers like Gmail.
- Flexibility: Move or upgrade your server later, and your IP changes. A domain name stays constant, so your users never lose access.
An IP address works fine while you're testing privately. Once you're ready to bring in real learners, connect a domain.
Additional Information and Examples
You can run cat /root/README.md to see more information and useful commands:
Example Output:
# Moodle
## Description
Moodle is a robust, secure, and integrated platform designed to create personalized online learning environments. Whether you are managing a small classroom or a large-scale corporate training program, Moodle provides the flexibility to scale and adapt to your needs.
### Key Features
* **Comprehensive Course Toolkit**: Build interactive courses with quizzes, assignments, forums, and wikis.
* **Flexible & Customizable**: Personalize your site with custom themes and extend functionality via a massive plugin library.
* **User-Friendly Management**: Access a personalized dashboard and use drag-and-drop tools to organize content easily.
* **Powerful Progress Tracking**: Monitor learner performance with advanced grading, automated reporting, and analytics.
* **Mobile-Ready**: A fully responsive interface and dedicated mobile app allow for learning anywhere, anytime.
## Services
Service | Ports | Purpose
----------------|-------|---------
OpenSSH | 22 | SSH
nginx | 80/443| Website access
Ports are protected using ufw.
## How-to-use
Post installation the password for mysql and the moodle admin password will be stored in /root/.app_passwords.
The site will be installed and configured on an ip address. When you access the server via the console there will be instructions on how to run a script to change the site over to the domain of your choosing.
## Links
Documentation: [https://docs.moodle.org/501/en/Main_page](https://docs.moodle.org/501/en/Main_page)