How to Set Up a VPS on HostGator with AlmaLinux 8

In this post, I’ll walk you through purchasing a VPS on HostGator, setting it up with AlmaLinux 8, and adding multiple users so they can access and work on the server. Whether you’re a beginner or an experienced user, this guide will help you get started with your VPS.

Step 1: Purchasing a VPS from HostGator

  1. Visit HostGator’s Website
    Head over to HostGator’s VPS Hosting page. Choose a plan that meets your needs, whether it’s for hosting websites, running applications, or managing databases.
  2. Selecting Your Plan
    HostGator offers several plans. I recommend starting with a mid-tier option that provides a balance between cost and resources.
  3. Complete the Purchase
    After selecting your plan, follow the steps to complete your purchase. You’ll receive an email with your VPS login details, including the IP address, username, and password.

Step 2: Accessing Your VPS Using SSH

Once you have your VPS, you’ll need to access it using SSH (Secure Shell).

  1. Open Terminal or SSH Client
    If you’re on Linux or macOS, you can use the terminal. Windows users can download and use PuTTY.
  2. Log In to Your VPS
    In your terminal, enter the following command:
ssh root@your_vps_ip
  1. Replace your_vps_ip with the IP address provided by HostGator. Enter the root password when prompted.

Step 3: Setting Up AlmaLinux 8 on Your VPS

With AlmaLinux 8, you get a stable and reliable environment for your applications.

  1. Update the System
    Start by updating the system to ensure all packages are up to date:
sudo dnf update -y

This command will update all installed packages to their latest versions.

Install Essential Tools
You might want to install additional tools like nano, wget, and curl:

sudo dnf install nano wget curl -y
  1. These tools will help you manage your VPS more effectively.

Step 4: Adding Users to Your VPS

Creating separate user accounts is crucial for managing multiple collaborators or organizing different projects.

  1. Create New Users
    To add a new user, run:
sudo adduser username

Replace username with your desired username. Then, set a password:

sudo passwd username
  1. Repeat for Additional Users
    Repeat the process to create up to five users, or more if needed.

Step 5: Configuring SSH Access for Users

For added security, you can configure SSH keys for your users.

  1. Generate SSH Keys
    Each user should generate an SSH key pair on their local machine:
ssh-keygen -t rsa

The user will generate a private key (which stays on their machine) and a public key (which will be uploaded to the server).

Copy the Public Key to the Server
The user can upload their public key to the server using:

ssh-copy-id username@your_vps_ip
  1. This setup will allow the user to log in securely without using a password.

Step 6: Testing and Finalizing the Setup

Before wrapping up, ensure that everything is working as expected.

  1. Test User Login
    Log out as root and try logging in as one of the new users:
ssh username@your_vps_ip
  1. Verify that each user can log in and access their home directory.
  2. Final Security Checks
    Ensure your firewall is active, and consider disabling root login over SSH to enhance security.

Conclusion

Congratulations! You’ve successfully set up a VPS on HostGator with AlmaLinux 8, added multiple users, and configured secure access. This setup is perfect for hosting websites, running applications, or learning more about server management. Stay tuned for more guides and tips!

Leave a Reply

Your email address will not be published. Required fields are marked *

*