How to Install and Set Up a VPS on Ubuntu, AlmaLinux, and Rocky Linux Print

  • install VPS Ubuntu, Linux VPS tutorial, VPS AlmaLinux setup, Rocky Linux VPS installation, how to setup VPS, VPS guide for beginners
  • 0

Introduction

Setting up your own VPS (Virtual Private Server) can seem intimidating, but it’s actually a straightforward process—especially with modern Linux distributions like Ubuntu, AlmaLinux, and Rocky Linux. In this guide, we’ll walk you through the steps to install, secure, and configure a VPS so it’s ready to host your applications, websites, or development projects.

What You Need Before You Begin

  • A VPS plan from a provider like HostPika, DigitalOcean, Vultr, or Linode
  • SSH access to your VPS (usually via IP address and root password)
  • Basic knowledge of the Linux command line

Step 1: Connect to Your VPS via SSH

Open your terminal and run:

ssh root@your_server_ip

Replace your_server_ip with your actual IP address.

Step 2: Update the System

# For Ubuntu
sudo apt update && sudo apt upgrade -y

# For AlmaLinux / Rocky Linux
sudo yum update -y
# or
sudo dnf update -y

Step 3: Create a New User (Optional)

adduser myuser
usermod -aG wheel myuser  # AlmaLinux / Rocky Linux
usermod -aG sudo myuser   # Ubuntu

This helps you avoid using root for daily operations.

Step 4: Set Up a Firewall

On Ubuntu:

sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status

On AlmaLinux / Rocky Linux:

sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

Step 5: Install Common Utilities

# Ubuntu
sudo apt install curl wget git unzip -y

# AlmaLinux / Rocky Linux
sudo yum install curl wget git unzip -y

Step 6: Install a Web Server

Install Apache or NGINX:

# Apache (Ubuntu)
sudo apt install apache2 -y

# Apache (AlmaLinux / Rocky)
sudo yum install httpd -y

# NGINX (Ubuntu)
sudo apt install nginx -y

# NGINX (AlmaLinux / Rocky)
sudo yum install nginx -y

Step 7: Secure Your VPS

  • Disable root SSH login in /etc/ssh/sshd_config
  • Set up SSH key authentication
  • Install Fail2Ban to protect against brute-force attacks:
# Ubuntu / Debian
sudo apt install fail2ban -y

# RHEL / Alma / Rocky
sudo yum install fail2ban -y

Conclusion

Installing and configuring a VPS on Ubuntu, AlmaLinux, or Rocky Linux is easier than ever with this guide. With just a few commands and configurations, your server will be up and running securely. Whether you're launching a blog, a business site, or a development environment—VPS hosting puts the control in your hands.

For advanced setup like Docker, cPanel, or WordPress deployment, check our upcoming tutorials or visit the VPS Hosting section on your provider’s knowledge base.


Was this answer helpful?

« Back