- What Is a Linux VPS?
- Step 1: Choose a VPS Provider and a Hosting Plan
- Step 2: Connect to Your VPS via SSH
- Step 3: Create a Non-Root User and Disable Root Login
- Step 4: Set Up SSH Key Authentication
- Step 5: Update Your System and Enable Automatic Updates
- Step 6: Secure Your VPS with a Firewall and Fail2Ban
- Step 7: Install the Software You Need
- Common Setup Issues and Quick Fixes
- FAQ
So you bought a Linux VPS. You have an IP address, a root password, and absolutely no idea what to do next. Many people feel the same way after their first VPS hosting purchase.
This guide shows you how to set up a Linux VPS from scratch, from the first SSH connection to a fully working, secure server. We will cover every step of the process, including how to set up Linux VPS security, install software, and get your virtual private server ready for real work. No prior experience needed.
What Is a Linux VPS?

A Linux VPS (virtual private server) is a portion of a physical server that acts as its own independent virtual machine. It runs a Linux operating system, and you get full root access to install software, change configurations, and run services however you want.
Why do people pick VPS hosting over shared hosting? A few good reasons:
|
Feature |
Shared hosting |
VPS hosting |
|
Performance |
Shared CPU and RAM |
Dedicated resources |
|
Control |
Limited |
Full root access |
|
Security |
Neighbors can affect you |
Isolated environment |
|
Customization |
Almost none |
Install anything you want |
|
Scalability |
Fixed |
Upgrade RAM, CPU, storage anytime |
VPS hosting gives you the freedom of a dedicated server without the price tag, and far more power than shared hosting can offer. Whether you are running a web server, a personal project, or a business application, a Linux VPS is often the sweet spot between cost and capability. Most VPS hosting providers let you choose from several Linux operating systems, and you can switch between them if you change your mind later.
Step 1: Choose a VPS Provider and a Hosting Plan

Before anything else, you need a provider. And there are dozens of them out there, so how do you decide? VPS hosting is a competitive market, much broader than shared hosting. Prices range from a few dollars a month all the way up to dedicated server territory, so understanding what you actually need saves you from overspending.
Here is what actually matters when choosing a VPS hosting plan:
- Location. Pick a data center close to your users. If your audience is in Europe, a server in Frankfurt or Amsterdam will be much faster for them than one in New York.
- Resources. How much RAM, CPU, and storage do you need? For a small website or a personal project, 2 GB of RAM and 1-2 CPU cores are usually enough. For heavier workloads, go higher.
- Operating system options. Most providers offer several Linux operating systems: Ubuntu, Debian, AlmaLinux, Rocky Linux. Ubuntu is the most beginner-friendly, and it has the biggest community.
- Support. If something breaks at 2 AM, will anyone respond? Look for providers with 24/7 support.
- Managed vs. unmanaged. With managed VPS hosting, the provider handles updates, security patches, and server configuration for you. An unmanaged VPS gives you full control, but you are responsible for everything. If you are comfortable with the command line (or want to learn), unmanaged is usually cheaper and more flexible.
- Operating system choices. Most providers offer Ubuntu, Debian, and at least one RHEL-based option. Make sure your preferred operating system is available before you commit.
Once you have signed up and selected a VPS hosting plan, your provider will spin up the virtual machine and send you the login credentials. Usually, that means a server's IP address, a username (typically "root"), and a password.
Get the most out of your budget with our affordable, efficient VPS solutions. Fast NVMe, 30+ countries, managed and unmanaged VPS.
Step 2: Connect to Your VPS via SSH
SSH (Secure Shell) is how you talk to your server. It creates an encrypted connection between your computer and the VPS, so everything you type travels safely over the internet.
On macOS or Linux, open Terminal. On Windows, you can use PowerShell or a tool like PuTTY. Then type:
ssh root@your_server_ip
Replace your_server_ip with the actual server's IP address your provider gave you. The first time you connect, your computer will ask you to confirm the server's fingerprint. Type yes and press Enter. Then enter your password.
If everything worked, you should see a command prompt on your server. It will look something like root@vps:~#. Congratulations, you now have SSH access to your Linux VPS.
Keep in mind that SSH access is your primary way of managing the server from this point on. Everything you do on your Linux VPS, from installing software to editing config files, will happen through this connection.
A quick tip: if your provider gave you a non-standard port (something other than 22), use the -p flag:
ssh -p 2222 root@your_server_ip
Step 3: Create a Non-Root User and Disable Root Login
Right now you are logged in as root. Working as root all the time is risky, and it also makes your server a bigger target. Automated bots scan the internet 24/7 trying to brute-force root passwords.
So the very first thing to do is create a regular user with sudo privileges:
adduser johndoe
usermod -aG sudo johndoe
Replace johndoe with whatever username you like. The system will ask you to set a password and fill in some optional information.
Now, open a new terminal window and test that you can log in as this user:
ssh johndoe@your_server_ip
Once confirmed, let's disable root login. Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config
Find the line that says PermitRootLogin yes and change it to:
PermitRootLogin no
Save the file and restart the SSH service:
sudo systemctl restart sshd
From now on, nobody (including you) can log in directly as root. You will log in as your regular user and use sudo when you need admin permissions. This one change eliminates an entire class of attacks against your virtual private server. It is one of the most important steps in any VPS configuration.
Step 4: Set Up SSH Key Authentication

Passwords can be guessed or brute-forced. SSH keys cannot.
On your local machine (not the server), generate a key pair:
ssh-keygen -t ed25519
Press Enter to accept the default file location. You can set a passphrase for extra protection, or leave it empty.
Now copy the public key to your server:
ssh-copy-id johndoe@your_server_ip
Test the connection. If it works without asking for a password, your keys are set up correctly.
The last step is to turn off password authentication entirely. On the server, open the SSH configuration file again:
sudo nano /etc/ssh/sshd_config
Find PasswordAuthentication and set it to no:
PasswordAuthentication no
Restart SSH:
sudo systemctl restart sshd
Step 5: Update Your System and Enable Automatic Updates
Every Linux operating system ships with packages that may already be outdated by the time you log in. Outdated software is one of the most common ways servers get compromised. No matter which operating system you picked during setup, the first order of business is always the same: update everything.
Run these commands to update system packages:
sudo apt update && sudo apt upgrade -y
That is for Ubuntu and Debian.
If you are on AlmaLinux or Rocky Linux, use:
sudo dnf update -y
While you are at it, set up automatic security updates. On Ubuntu or Debian:
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades
Select "Yes" when prompted. Your server will now install critical security patches automatically in the background. You will still want to check in and do a full manual update from time to time, but at least the most urgent fixes will not wait around for you.
Step 6: Secure Your VPS with a Firewall and Fail2Ban
Your virtual private server is on the public internet. That means anyone can try to connect to any open port. A firewall limits which ports accept traffic.
On Ubuntu and Debian, UFW (Uncomplicated Firewall) is the standard:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw enable
If you are running a web server, open HTTP and HTTPS too:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
If you changed your SSH port, make sure to allow that specific port before enabling UFW. Otherwise, you will lock yourself out.
Next, install Fail2Ban. This tool watches your log files and automatically bans IP addresses that fail too many login attempts:
sudo apt install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
Create a local config file so your settings survive updates:
sudo nano /etc/fail2ban/jail.local
Add the following:
[sshd]
enabled = true
port = ssh
maxretry = 5
bantime = 3600
Restart Fail2Ban:
sudo systemctl restart fail2ban
These two tools together (firewall plus Fail2Ban) form the baseline of VPS security for any Linux VPS. They will not make your server bulletproof, but they will stop the vast majority of automated attacks. Most VPS hosting providers also offer network-level firewalls through their control panel, so check if yours does and enable it as an additional layer.
Step 7: Install the Software You Need

Your server is updated and secured. Time to put it to work. What you install depends entirely on what you want to do, but here are the most common starting points.
Web server. If you plan to host websites, install Nginx:
sudo apt install nginx -y
sudo systemctl enable nginx
Nginx is fast, lightweight, and works great as both a web server and a reverse proxy. Apache is another option, but for most new setups, Nginx is the standard.
SSL certificates. Every website needs HTTPS. Certbot from Let's Encrypt makes this free:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com
Certbot will automatically configure your Nginx web server to use SSL and set up auto-renewal.
Docker. In 2026, Docker is pretty much the default way to run applications on a Linux VPS. Instead of installing everything directly on the server, you run apps inside containers. This keeps things clean and makes it easy to move between servers.
sudo apt install docker.io docker-compose -y
sudo systemctl enable docker
With Docker installed on your virtual private server, you can deploy apps with a single config file.
Monitoring. Once your server is running, you want to know if something breaks. Tools like Uptime Kuma or Netdata let you monitor uptime, CPU, memory, and disk usage right from a browser dashboard. Both run well on even a small Linux VPS and take just a few minutes to install via Docker.
At this point, your VPS hosting setup is functionally complete. You have a secured, updated Linux VPS running the software you need. The core Linux server setup is done. Everything from here is about fine-tuning and adding more services as your needs grow.
Common Setup Issues and Quick Fixes

Things go wrong. That is part of the process. Here are the problems people hit most often during a Linux server setup, and how to fix them. Most of these come up within the first hour of working with a new virtual private server, so do not panic if you run into one.
|
Problem |
Likely cause |
Fix |
|
"Connection refused" when connecting via SSH |
SSH service not running, or wrong port |
Check sudo systemctl status sshd and verify the port |
|
Locked out after enabling UFW |
Forgot to allow SSH port |
Use provider's web console to log in and fix firewall rules |
|
"Permission denied (publickey)" |
SSH keys not copied correctly, or password auth already disabled |
Re-copy keys from provider's recovery console |
|
apt update fails with errors |
Broken package sources |
Check /etc/apt/sources.list for typos |
|
High CPU usage right after setup |
Automatic updates or indexing |
Wait 10-15 minutes, then check with htop |
|
Cannot access the website from the browser |
Firewall blocking port 80/443, or server not running |
Run sudo ufw allow 80/tcp and check Nginx status |
If you ever lock yourself out completely, nearly every VPS hosting provider offers a web-based console or recovery mode. Check your provider's control panel for a "Console" or "VNC" option. This gives you direct access to your Linux VPS even if SSH is broken. This is a standard feature across nearly all VPS hosting services.
Dedicated space for backups of your project or for personal use.
FAQ
How do I connect to a Linux VPS?
Open a terminal on your computer and type ssh username@your_server_ip. On Windows, you can use PowerShell or PuTTY. You will need the server's IP address and your login credentials. Once key-based authentication is configured, you will not need a password at all. If you are still figuring out how to set up Linux VPS for the first time, connecting via SSH is always the starting point.
How do I use a Linux VPS?
After the initial VPS configuration, you manage everything through the command line. Install a web server to host sites, deploy Docker containers for applications, set up databases, run scripts, schedule backups. A Linux VPS is a general-purpose machine with full root access, so unlike shared hosting, you can install any self-hosted tools you want. Popular options include Docmost for documentation, Uptime Kuma for monitoring, OpenWeb UI and Dify.AI for AI-powered tools. The possibilities are wide open.
How do I get multiple IPs on a Linux VPS?
This depends on your provider. At is*hosting, you can assign up to 256 IPv4 addresses to a single VPS. To get an additional IP address, create a ticket to the Billing department. Note that after adding a new IP, the server will need a reboot, so specify a convenient time for it in your ticket.
The cost is $4.00 per month for one IPv4 address. If you order more than 10 IPs, a discount is possible. IPv6 addresses are free of charge (up to 64) on servers in all locations using KVM virtualization. If you need more than 64, the cost is $0.01 per IP.
Do I need a control panel (cPanel, CyberPanel, Coolify) or is CLI enough?
That depends on your comfort level. If you prefer a graphical interface and want to manage sites, databases, and email from a browser, a control panel will save you time. Coolify is a popular free option that works especially well for Docker-based deployments. CyberPanel is another solid free choice. cPanel is the industry standard, but it costs money.
If you are comfortable with the terminal, you do not strictly need a control panel. Many experienced admins run their Linux VPS servers without one. A control panel does use server resources (RAM, CPU), so skipping it leaves more for your actual applications.
Which Linux distro should I choose for my VPS?
For most people, Ubuntu (the latest LTS version) is the safest bet. It has the largest community, the most tutorials online, and packages tend to be up to date. Debian is a close second if you prefer something more conservative and stable. AlmaLinux and Rocky Linux are solid options if you come from a CentOS background.
Your choice of operating system affects which package manager you use, how often you get updates, and how much community support is available. Most VPS hosting providers support all major Linux operating systems out of the box. If you want a detailed breakdown and comparison, check out the full guide.
In the end, the best operating system is the one you are most comfortable working with. If you are new to all of this, start with Ubuntu. You can always reinstall a different Linux VPS image later if you change your mind.
- What Is a Linux VPS?
- Step 1: Choose a VPS Provider and a Hosting Plan
- Step 2: Connect to Your VPS via SSH
- Step 3: Create a Non-Root User and Disable Root Login
- Step 4: Set Up SSH Key Authentication
- Step 5: Update Your System and Enable Automatic Updates
- Step 6: Secure Your VPS with a Firewall and Fail2Ban
- Step 7: Install the Software You Need
- Common Setup Issues and Quick Fixes
- FAQ