SolaDrive Blog

The Ultimate Step-by-Step Guide to Setting Up a Linux VPS for Beginners

Category Icon Category: Blog
Posted On Icon Posted on:
Oct 20, 2026
Featured image

To set up a Linux VPS, you connect over SSH, update the system, create a non-root user, secure remote access, install a web server, add an SSL certificate, and schedule backups. The order matters. Skipping security checks or changing SSH settings too early can leave your server exposed or lock you out.

We’re SolaDrive, and we specialize in managed VPS and dedicated servers. Our engineers handle this process regularly. Each step shared below includes the commands and the reasoning behind them.

What You Need Before Starting Your Linux VPS Setup

Before you begin, gather four things: an active VPS plan, a terminal application, your login details, and roughly an hour of uninterrupted time. A domain name helps, though you can add one later.

Mac and Linux computers include a terminal by default. Windows 10 and 11 users can open PowerShell or Windows Terminal, and both support SSH natively.

Once your server is provisioned, you’ll receive an IP address, a username (usually root), and a temporary password. Store them somewhere safe. If you want a plan built for first-time server owners, our managed Linux NVMe VPS plans include engineer support from day one.

Choosing an Operating System: Ubuntu or AlmaLinux

Choose Ubuntu if you want the largest library of tutorials and the gentlest learning curve. Choose AlmaLinux if you prefer a stable, enterprise-style system that follows the Red Hat family.

We support Ubuntu, AlmaLinux, and Windows environments. Teams that need Windows can run Windows Server 2016, 2019, 2022, or 2025.

Our VPS plans run on KVM virtualization, which gives each server isolated resources and full control over its own operating system. That isolation matters when a neighbor’s traffic spikes and you’d rather not feel it.

Picking a Data Center Near Your Visitors

Choose the location closest to most of your visitors, because shorter distance means lower latency and faster page loads. You usually make this choice when you order, and moving later takes extra work.

We operate five data centers: Los Angeles, Buffalo NY, Seattle, Coventry UK, and Singapore. Los Angeles and Seattle suit audiences on the US West Coast. Buffalo NY serves the East Coast and Midwest well. Coventry UK covers European traffic, and Singapore does the same for Asia-Pacific.

How to Connect to Your Linux VPS Using SSH

SSH creates an encrypted session between your computer and the server. You’ll use it for nearly every task from here on.

Open your terminal and run this command, replacing the placeholder with your server’s IP address:

ssh root@your_server_ip

The first time you connect, SSH may ask you to verify the server’s host key fingerprint. Before you accept it, check the fingerprint against a trusted value from your hosting control panel or your support team. If the two match, type yes, then enter the password from your welcome email.

Once you’re in, a prompt ending in # usually means you’re logged in as root. If the connection won’t go through, go back over the basics: the IP address, the username, your credentials, the SSH port. Then check whether the server itself is actually up. Also confirm that your local network and any provider-level firewall allow SSH traffic. If you still cannot connect, our 24/7 US-based support team responds within 15 minutes and can check the server from our side.

Updating Packages and Creating a Non-Root User

Update the system before you install anything. Fresh images often ship with packages that are weeks behind, and some of those updates are security patches.

On Ubuntu, run:

apt update && apt upgrade -y

On AlmaLinux, run:

dnf update -y

Next, stop using root for routine administration. Commands executed as root can change or delete critical system files, so a separate administrative account helps limit unnecessary use of full privileges.

On Ubuntu, create a new user and grant administrative access:

adduser yourname

usermod -aG sudo yourname

On AlmaLinux, add the user to the wheel group instead:

adduser yourname
passwd yourname

usermod -aG wheel yourname

Log in as the new user and confirm that administrative commands work with sudo. Keep your existing root session open until you have verified that the new account can log in and perform the tasks it needs to handle.

Setting the correct timezone with sudo timedatectl set-timezone Region/City also helps keep logs readable. Replace Region/City with your actual timezone.

VPS Server Security Basics: SSH Keys, Firewall, and Fail2ban

Strong VPS server security basics cover three layers: key-based login, a firewall, and automated blocking of repeated login attempts. Set them up in that order, before you publish anything.

Switch from Passwords to SSH Keys

SSH keys provide a more secure alternative to password-based authentication when configured correctly. Generate a key pair on your own computer:

ssh-keygen -t ed25519

Follow the prompts and protect your private key with a passphrase. Next, copy the public key to your server:

ssh-copy-id yourname@your_server_ip

Linux and macOS usually have this command built in, but Windows often doesn’t. If it’s missing on your machine, follow your operating system’s instructions for adding the public key to the server account’s ~/.ssh/authorized_keys file.

Open a second terminal and test the new key-based login. Make sure that account can also run admin commands with sudo. Don’t close your original session until the new connection works.

Once access is confirmed, go through /etc/ssh/sshd_config and any included files under /etc/ssh/sshd_config.d/. Set PermitRootLogin no and PasswordAuthentication no, as long as that fits how you need to access the server. Before you apply anything, check the effective SSH settings and validate the configuration syntax.

Run both commands:

sudo sshd -T | grep -E ‘permitrootlogin|passwordauthentication’

sudo sshd -t

If the validation command reports an error, fix it before you go any further. Once it passes, reload the SSH service. The service name depends on your distribution: usually ssh on Ubuntu and sshd on AlmaLinux. Keep your original session open, and open a fresh key-based connection to confirm it works before you close anything. It’s also smart to make sure you can reach your hosting provider’s console or rescue tools, in case you need to recover.

If you’re on a SolaDrive managed plan, check with our support team before changing SSH access settings.

Enable a Firewall

A firewall decides which network connections are allowed to reach your server. Before you turn one on, confirm which SSH port your server uses and make sure that port is allowed. Block it by accident and you could lose remote access completely.

On Ubuntu, UFW provides a straightforward way to manage firewall rules. For a server using the default SSH port, run:

sudo ufw allow OpenSSHsudo ufw allow 80/tcpsudo ufw allow 443/tcpsudo ufw enablesudo ufw status verbose

If SSH uses a custom port, allow that port instead of relying only on the default OpenSSH rule. Confirm that the required rules are active before ending your current session.

On AlmaLinux, firewalld is commonly used. If your server uses its default SSH service and hosts a website over HTTP and HTTPS, you can allow the required services with:

sudo firewall-cmd –permanent –add-service=sshsudo firewall-cmd –permanent –add-service=httpsudo firewall-cmd –permanent –add-service=httpssudo firewall-cmd –reloadsudo firewall-cmd –list-services

Adjust these rules if SSH uses a custom port or your applications require additional network access. Also check any firewall or security group managed through your hosting provider. Server-level and provider-level firewall rules must both allow the traffic your applications need.

Install Fail2ban and Automatic Security Updates

Public servers receive automated login attempts, so protecting SSH access and applying security patches regularly are important parts of server maintenance.

Fail2ban can monitor supported log files and temporarily block IP addresses that repeatedly trigger configured authentication failures. Install it using the package source appropriate for your Linux distribution, then verify that its service is running and that the SSH protection rules match your server’s configuration. Fail2ban complements SSH keys and firewall rules; it does not replace them.

Automatic security updates can help reduce the time your server remains exposed to known vulnerabilities. Ubuntu provides unattended-upgrades, while AlmaLinux users can configure dnf-automatic where supported.

Check the installation, configuration, and service or timer status rather than assuming updates are running automatically. Also plan for kernel updates that require a reboot and monitor applications after important changes.

On our managed Linux VPS plans, we handle much of this hardening ourselves. We also run proactive and predictive monitoring, which lets us flag unusual behavior before it becomes downtime.

Installing Nginx and Pointing Your Domain to the Server

Nginx is a widely used web server and a practical choice for hosting websites on a Linux VPS.

On Ubuntu, install Nginx with:

sudo apt updatesudo apt install nginx -y

On AlmaLinux, run:

sudo dnf install nginx -y

Enable and start the service:

sudo systemctl enable –now nginxsudo systemctl status nginx

Open your server’s IP address in a browser. If Nginx is running and network access is set up right, you should see its default welcome page. If the page won’t load, check the service status first. Then look at the server firewall, the provider-level firewall, and your network connectivity.

To connect a domain, open the DNS settings at your registrar and create an A record that points to your server’s IPv4 address. If you plan to serve the site over IPv6 too, add an AAAA record with the correct IPv6 address. Don’t panic if the change doesn’t show up right away. Caching and TTL settings can delay it.

Once the domain is pointing at your server, set up an Nginx server block for it. Test the configuration before you reload Nginx. You can then deploy WordPress, a Node.js application, or a database-backed website using the installation and security requirements appropriate to that application.

Adding a Free SSL Certificate with Let’s Encrypt

Configure HTTPS before launching your website. Let’s Encrypt gives you free TLS certificates, which let browsers open encrypted connections to your domain.

Before you request one, make sure your domain’s DNS already points at the server and that the validation method you’re using can actually be reached. For a typical Nginx setup with HTTP validation, port 80 has to be open. Port 443 needs to be allowed too, since that’s where the HTTPS traffic comes in.

Install Certbot along with its Nginx integration, using the official instructions for your operating system. Then request the certificate for your domain. On a supported setup, Certbot can configure Nginx for you automatically:

sudo certbot –nginx -d example.com -d www.example.com

Replace the example domains with your actual domain names and include only the names configured to point to your server.

After installation, visit your website using https:// and confirm that the certificate is valid and the page loads correctly. You can also test certificate renewal with:

sudo certbot renew –dry-run

Verify that automatic renewal is configured and that the renewal test succeeds. Certificate installation alone is not enough; renewal must continue working to prevent the certificate from expiring.

Setting Up Backups for Your Linux VPS

Store backups separately from the server they protect. A backup on the same disk may be lost if the disk fails, the server is compromised, or someone accidentally deletes important files.

We offer two professional backup solutions. R1Soft backup takes frequent block-level snapshots, which lets us restore individual files or an entire server. Acronis backups provide image-based protection for the full system, which suits teams that want a complete restore point.

Before you pick a backup setup, work out three things. How often does your data need to be backed up? How long should you keep those backups? And how fast do you need to be back up and running if something breaks? Then make sure the backup actually covers what your application depends on: databases, website files, configuration files, and any other assets it needs to run.

Lock down who can get at the backups, with proper permissions and encryption if it’s available. Then keep an eye on it. Check that the schedule is actually running and read the backup reports for failures. Every so often, try restoring some files, or the whole system, in a test environment. A backup you’ve never restored is just a guess.

Why a Managed VPS Saves Time After Setup

Setup is a one-time job, while maintenance never ends. Patches, monitoring, and troubleshooting add up, and they tend to arrive at inconvenient hours.

With managed VPS hosting, our engineers take on that server-level work so you can focus on your site and business. With SolaDrive, you get:

  • 24/7 US-based support with a 15-minute response time
  • A 100% network uptime SLA that backs our availability commitment
  • Proactive and predictive monitoring that helps us catch issues early

If your traffic outgrows a VPS, our managed dedicated servers run on Intel Xeon and AMD EPYC processors, with Ryzen options as well.

Hosting That Matches Real Work: ERP on a Managed VPS

Some workloads demand more than a standard web stack. ERP platforms are a clear example, because they run accounting, inventory, and payroll for the whole company.

We specialize in ERP hosting for Odoo and ERPNext. When these systems slow down, employees stop working, so configuration and monitoring matter far more than on a hobby site. Our managed Odoo hosting applies the practices from this guide at business scale.

Ready to Set Up Your Linux VPS? Talk to Our Team

You now have the full sequence: connect, update, create a user, secure SSH, enable the firewall, install Nginx, add SSL, and schedule backups. Following it carefully gives you a server you can trust.

For managed Linux VPS services, contact SolaDrive for a free consultation. We’ll help you choose a plan, a data center, and a backup option that fits your project. You can also see our managed VPS plans and get started today.

Frequently Asked Questions About Linux VPS Setup

Can I host multiple websites on one Linux VPS?

Yes. Create a separate Nginx server block for each domain and point each domain’s DNS at the server. How many sites you can fit comes down to CPU, RAM, and traffic. Keep an eye on resource usage as you add them, and upgrade the plan once performance starts to slip.

What should I do if I get locked out of my Linux VPS?

Start with the basics: the server IP address, your username, the SSH port, and your network connection. If you recently changed SSH or firewall settings, that’s the likeliest culprit.

If SSH won’t work at all, use your hosting provider’s web console, serial console, or rescue environment, if they offer one. Those let you look at the SSH configuration, firewall rules, and service status without needing a normal SSH connection.

Disabled password authentication before checking that your SSH key worked? Then you’ll probably need console or rescue access to get back in. And if you can’t sort it out safely on your own, contact your hosting provider’s support team.

How often should I update a Linux VPS?

Check for updates at least once a week, and don’t sit on security patches. How fast you apply them depends on how serious they are and what your maintenance window looks like. Automatic security updates shrink the time your server stays exposed to known vulnerabilities, but don’t just trust them. Verify that the updates are actually getting installed.

Some updates, kernel updates especially, don’t take effect until you reboot. So check whether one is needed and schedule it for a sensible time. On a production server, back up your important data before any big change. Test major operating system upgrades on a staging environment first, since they can break application compatibility or change how the server behaves.

How can I tell if my Linux VPS has been compromised?

Things to watch for: odd spikes in CPU or network activity, user accounts you don’t recognize, unknown processes, files that changed when they shouldn’t have, and logins or login attempts you can’t explain. On Ubuntu, look at /var/log/auth.log where it applies. On AlmaLinux, check /var/log/secure. If your logging is set up differently, those records may live somewhere else. None of these signs proves a compromise by itself, but each one is worth digging into.

If you think someone got in, limit the server’s exposure where you can and contact your hosting provider or security team. Work out how they got in, rotate any credentials that may have been exposed, and think about rebuilding from a clean image and restoring verified data from a known-good backup. Changing passwords alone may not shut an attacker out.

What is the difference between managed and unmanaged VPS hosting?

An unmanaged VPS gives you the server and leaves all administration to you, including updates, security, and troubleshooting. A managed VPS adds a provider’s engineering team, which handles those tasks and responds to problems. Unmanaged plans cost less. Managed VPS plans save time and reduce risk for people without dedicated IT staff.