Comparisons & Alternatives

How to Configure a HostGator VPS Server from Scratch

Learn how to set up your HostGator VPS from first SSH login to a fully running, secure web server in a few straightforward steps.

Close-up of a business strategy diagram on a clipboard with a hand writing.

To configure a HostGator VPS, connect via SSH using the credentials in your welcome email, update the operating system, and install the software your site needs — Apache, MySQL, PHP, or a control panel. You can have the server ready to go in under an hour.

This guide walks through every step in order: from receiving your activation email to loading your first webpage in a browser.

Before You Start: What Your HostGator VPS Includes

HostGator VPS plans come with CentOS or Ubuntu pre-installed, full root access, and an optional control panel (cPanel/WHM or Plesk, depending on the plan). When the service activates you'll receive an email with:

  • Your server's public IP address.
  • The root username and a temporary password.
  • The SSH port (default: 22).

Have an SSH client ready. On Windows you can use PuTTY or the built-in terminal (Windows 10/11); on macOS and Linux the system terminal works out of the box.

Step 1: First SSH Login and Password Change

Open your terminal and connect:

ssh root@YOUR_PUBLIC_IP

The first time you connect, the system will ask you to confirm the server's fingerprint — type yes. Then enter the temporary password from the welcome email.

Change the root password immediately to something strong:

passwd

Pick a password of at least 16 characters with uppercase letters, numbers, and symbols. Never reuse passwords from other services.

Step 2: Update the Operating System

A freshly provisioned server almost always has outdated packages. Run the appropriate command for your distro:

CentOS / AlmaLinux:

dnf update -y

Ubuntu / Debian:

apt update && apt upgrade -y

This may take several minutes. If the kernel was updated, reboot:

reboot

Reconnect via SSH after 30–60 seconds.

Step 3: Install the Web Stack (LAMP)

For most PHP sites — including WordPress — the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) is the standard choice.

On Ubuntu/Debian

apt install apache2 mariadb-server php libapache2-mod-php php-mysql -y

On CentOS/AlmaLinux

dnf install httpd mariadb-server php php-mysqlnd -y
systemctl enable --now httpd mariadb

Verify Apache is running by visiting http://YOUR_PUBLIC_IP in a browser. You should see the default welcome page.

Secure MariaDB

mysql_secure_installation

Follow the wizard: set a root password, remove anonymous users, and disable remote root access. It takes less than two minutes.

Step 4: Basic Security Hardening

A VPS exposed to the internet without minimum safeguards will receive intrusion attempts within hours. These steps are not optional:

  • Firewall: enable ufw (Ubuntu) or firewalld (CentOS) and open only ports 22 (SSH), 80 (HTTP), and 443 (HTTPS).
  • Change the SSH port: edit /etc/ssh/sshd_config, set Port to a high number (e.g. 2222), and restart the service.
  • Disable root SSH login: in the same file, set PermitRootLogin no and create a regular user with sudo privileges.
  • SSH keys: generate a key pair on your local machine and copy the public key to the server with ssh-copy-id. Once confirmed working, disable password authentication.

If you're unsure which provider best fits your security requirements, elenlace.com publishes up-to-date comparisons of VPS and hosting plans to help you decide.

Step 5: Point Your Domain to the VPS

In your domain registrar's DNS panel, create or edit an A record pointing your domain (and www) to your VPS public IP. Propagation takes anywhere from 15 minutes to 48 hours depending on your TTL setting.

Once propagated, set up an Apache VirtualHost for your domain:

<VirtualHost *:80>
    ServerName yourdomain.com
    ServerAlias www.yourdomain.com
    DocumentRoot /var/www/yourdomain
</VirtualHost>

Enable the site and reload Apache:

a2ensite yourdomain.conf
systemctl reload apache2

Key Takeaways

  • Your first SSH login is the starting point — change the root password right away.
  • Updating the OS before installing any software eliminates known vulnerabilities.
  • The LAMP stack covers the vast majority of PHP and WordPress projects.
  • Basic hardening (firewall, SSH port change, disabling root login) is mandatory on any internet-facing server.
  • DNS propagation takes time — plan your domain cutover in advance.

Rather have an expert team configure and manage your VPS for you? Explore server management services at elenlace.com and skip the learning curve. You can also browse more hosting guides in our hosting comparisons section.

FAQ

Do I need to know Linux to configure a HostGator VPS?

The basic commands in this guide are enough to get started. If you prefer a graphical interface, HostGator offers VPS plans that include cPanel/WHM, making server management possible without touching the command line.

How long does it take to activate a HostGator VPS?

Activation typically completes within minutes after payment is confirmed. In rare cases it can take up to 24 hours due to automated fraud review processes.

Can I install WordPress directly on the VPS?

Yes. Once the LAMP stack is in place, download WordPress with wget, create a MySQL database, and run through the browser-based installer. You can also use WP-CLI to automate the entire process.

Does the HostGator VPS include a free SSL certificate?

VPS plans don't automatically include SSL the way shared hosting plans do. However, you can install Let's Encrypt via Certbot for free in just a few minutes to enable HTTPS on your domain.

Further reading

Other providers and guides worth comparing:

← All