Sponsored by RamNode - Get a free $5 credit when you sign up, no credit card required! Use code KOROMATECH in the secret code field.


👉 Click Here to Claim Your $5 Credit


If you've spent any time in the self-hosting world, you've probably heard the term "VPS" thrown around constantly. And if you're like most people just getting started, you've probably nodded along while having absolutely no idea what one actually is or why you'd want one. That changes today.

In this guide, we're going to break down what a VPS actually is, walk through how to set one up from scratch, lock it down properly, install Docker, and deploy a real application on it. By the end, you'll not only have a running server on the internet, but you'll actually understand what you built and why each step matters. There's a Command Reference Guide at the bottom of this post for when you're ready to get your hands dirty.

The entire demo in this guide runs on RamNode, who are sponsoring this post. RamNode is a hosting provider offering VPS and cloud infrastructure with NVMe storage, multiple data center locations, and flexible deployment options built for developers, self-hosters, and home lab environments. If you want to follow along or just take their platform for a spin, they're offering a free trial to readers here. Click the link above, sign up, and a $5 credit gets added to your account automatically. You can also enter KOROMATECH in the secret code field.

What Is a VPS, and Why Should You Care?

Let's start with the physical world. A server is just a computer with a CPU, RAM, storage, and a network connection. Simple enough. Now imagine a hosting provider owns a massive physical server and instead of giving you the entire machine, they use virtualization software to slice it up into dozens of smaller isolated environments. Each one of those slices is a Virtual Private Server, or VPS.

Your VPS gets its own dedicated CPU allocation, its own RAM, its own storage, its own operating system, and its own network access. Even though you're technically sharing physical hardware with other customers, your environment is completely isolated from theirs. It feels like having your own private server because, for all practical purposes, it is.

This matters because it puts you in control. You can install whatever software you want, create users, configure firewall rules, host websites, run containers, and manage the operating system however you see fit. Compare that to shared hosting, where hundreds or thousands of websites share the same environment and you have almost no control over anything. And compare it to a dedicated server, where you get an entire physical machine to yourself but pay a significant premium for it. A VPS sits right in the sweet spot between the two.

Setting Up Your VPS on RamNode

When you first log into RamNode, you'll land on the client area, which shows your account overview, active services, billing, and support tickets. It can feel like a lot at first, but most of what you'll work with day to day lives in one place: the cloud control panel.

From the RamNode cloud control panel, you can manage instances (your actual servers), networking, storage volumes, SSH keys, firewall rules, and backups. We'll touch on the once we need to understand as we go.

Create an SSH Key

Before we even think about spinning up a server, we need to set up an SSH key. This is how you'll securely connect to your VPS from your local machine. Think of it like a lock and key system where the public key lives on the server and the private key lives on your computer. Anyone trying to connect without the right private key gets turned away at the door, no matter what.

RamNode let you generate a key pair directly in the dashboard. When you do, you'll get both a public key and a private key. The public key gets added to your VPS at creation. The private key needs to be saved on your local machine and treated like a password. Never share it, never commit it to a repository, never send it over chat. Store it somewhere safe.

Once you're ready, save the SSH key to your account so it's ready to attach when you create your instance.

Create Your VPS Instance

Creating an instance is where things start to feel real. You'll walk through a creation form that asks for a few key decisions. The first is your server's name, which is just a label to help you identify it later. Nothing technical here.

Next is the region. Pick a data center location that's geographically close to you or your intended users. This keeps latency low and makes the connection feel snappy.

Then you'll choose a plan, which determines your CPU, RAM, and storage allocation. For testing or light workloads, a smaller plan works fine. If you're running something more resource-intensive, size up accordingly. Keep in mind your monthly cost scales directly with the plan you choose.

After that, you select your operating system. RamNode offers a good ammount of OSs, but for this Demo I'm going to go with Ubuntu.

You'll also choose your networking options. For a publicly accessible server, you'll want a public IP address. If you also want the server to communicate privately with other resources in your hosting environment, a private IP is useful too.

Finally, attach the SSH key you created in the previous step. This is the part that actually enables secure access. Skip the password field if you're using SSH keys, which you should be.

Once you click create, the instance will spin up in a matter of seconds. You'll be taken to its dashboard where you can see live metrics, network configuration, system logs, snapshots, storage volumes, and more.

Lock Down Your Firewall

This is the step most guides rush through, and it's the one that matters most. When a VPS is first created, the default firewall rules are sometimes wide open. That means anyone on the internet can attempt to connect to any port on your server. That's not acceptable.

Your server will be scanned by automated bots within minutes of being created. That's not paranoia; that's just the reality of having a public IP address. So before we do anything else, we tighten the rules.

Navigate to your security groups or firewall settings and delete the default rules that allow all inbound traffic. Then create new, specific rules in their place.

The first rule you need is for SSH on port 22. Here's the critical part: instead of opening this port to the entire internet, restrict it to your own public IP address. Your public IP is what your internet service provider assigns to your home or office network. You can find it by searching "what is my IP" in a browser. By restricting SSH access to only your IP, you ensure that even if someone knows your server exists, they can't even attempt to log in unless they're on your network.

The second rule you need is for whatever application you plan to deploy. In this Demo I'm install Home Assistance. If you're running an app that serves traffic on a specific port, open only that port, and again, restrict it to your IP unless the app genuinely needs to be publicly accessible.

Leave your outbound (egress) rules as-is. Your server needs to be able to reach the internet to download packages, pull container images, and communicate outward.

One thing worth knowing: if your home or office internet connection doesn't have a static IP (most residential connections don't), your public IP will eventually change. When that happens, you'll need to update your firewall rules. It's a minor inconvenience, but it's worth being aware of so you're not locked out of your own server one day wondering what happened.

Connect to Your Server via SSH

Now that your server is up and your firewall is configured, it's time to actually get in. Grab the public IP address of your VPS from the instance dashboard. This is the address that points to your server on the internet, not your local IP.

On your local machine, you'll need to place your private SSH key in the appropriate directory and set the correct file permissions on it. File permissions matter here because SSH will actually refuse to use a private key file that's too permissive. It's a security feature, not a bug.

Once your key is in place with the right permissions, you can SSH into your server using a single command that references the key file, your username, and the public IP of your VPS. When you connect successfully for the first time, you'll see your server's terminal prompt. You're in.

Installing Docker and Deploying an Application

With a working server in front of you, the real fun begins. We're going to install Docker, which is a platform for running applications inside containers. Containers let you package an application and all its dependencies together so they run the same way everywhere. Instead of wrestling with manual installs and dependency conflicts, you define what you want and Docker handles the rest.

Docker provides an official installation script that handles everything automatically: adding the right software repositories, installing Docker and Docker Compose, and setting up the necessary dependencies. After running the script, you start and enable the Docker service so it runs automatically whenever the server boots.

At this point you can verify your install by checking the installed versions of Docker and Docker Compose. If both commands return a version number, you're good to go.

The recommended way to manage Docker-based apps is through Docker Compose, which lets you define your entire application stack in a single configuration file. You create a directory to keep things organized, drop in a docker-compose.yml file with your application's configuration, and run one command to pull the container image and start the service.

Once it's running, you can verify everything is working with docker ps, which lists all running containers along with the ports they're using. To access the application, you open a browser and navigate to your VPS's public IP followed by the port the app is running on.

That's it. You've gone from an empty server to a running web application with a publicly accessible interface.

A Word on Security Before You Move On

Setting up a VPS and deploying an app is genuinely exciting. But before you start opening ports and pointing domain names at things, take a moment to think about your security posture.

The moment an application is on a server with a public IP, it is a target. Bots crawl the entire internet constantly looking for exposed services. A login page is not protection. A container is not protection. The only real protection is careful, layered security design.

Start locked down and open things up only as you need to. Keep your operating system updated. Review your firewall rules regularly. Avoid exposing services directly to the internet if you can route them through an authenticated proxy instead. Building good habits now will save you from headaches later.

Command Reference Guide

Everything below is what you'll actually type when setting this up yourself. Commands are organized in the order you'll use them.

Adding Your SSH Private Key on Your Local Machine

Navigate to your SSH directory. If it doesn't exist yet, create it first.

  • cd ~/.ssh

 If the directory doesn't exist, create it

  • mkdir -p ~/.ssh

Create a file to store your private key

  • nano ~/.ssh/your-key-name

Paste your private key content, save, and exit

Then set the correct file permissions (required by SSH)

  • chmod 600 ~/.ssh/your-key-name

Connecting to Your VPS

Replace your-key-name with whatever you named your key file and YOUR_VPS_PUBLIC_IP with the public IP from your instance dashboard.

  • ssh -i ~/.ssh/your-key-name root@YOUR_VPS_PUBLIC_IP

Updating the Server

Once connected, run a full system update before doing anything else.

  • apt update && apt upgrade -y

Installing Docker

Pull and run the official Docker install script

  • curl -fsSL https://get.docker.com | sh

Enable Docker to start on boot

  • systemctl enable docker

Start the Docker service

  • systemctl start docker

Verify the installation

  • docker --version
  • docker compose version

Creating Your Application Directory

Create a directory for your application

  • mkdir ~/your-app-name

Navigate into it

  • cd ~/your-app-name

Create a Docker Compose configuration file

  • nano docker-compose.yml

Paste your application's Docker Compose configuration into the file, then save and exit.

Starting Your Application

Pull images and start all services in the background

  • docker compose up -d

Verify the container is running and note the port

  • docker ps

Accessing Your Application

Open a browser and navigate to:

  • http://YOUR_VPS_PUBLIC_IP:PORT

Replace YOUR_VPS_PUBLIC_IP with your server's public IP and PORT with the port shown in the docker ps output.

Final Thoughts

That's the foundation. You now have a server, a secured firewall, Docker installed, and an application running on it. If you're still looking for a place to host, RamNode gives you the flexibility to build and experiment without dedicated server pricing, and once you understand how a VPS works, you start to understand the foundation of how a lot of modern hosting and cloud infrastructure actually operates.

In the next video, we'll go further by setting up a reverse proxy in RamNode that lets you put proper authentication and access control in front of everything, so you're not just relying on a login form to keep things safe. Stay tuned.

About the author

Quiet Engineer

A lifelong learner with a passion for tech and soccer. Koroma Tech is where I share my journey and help others along the way. I enjoy taking on challenges and see each one as a chance to learn and grow.

>