Skip to content
Login
Sable Servers Sable Servers
    • Game ServersMinecraft, Rust, ARK, Palworld and more
    • Cloud Compute (VPS)Linux, Windows and HomeLab, full root
    • Object StorageS3-compatible buckets, kept in Canada
    • Web HostingWebsites with SSL, email and backups
    • Managed ServersWe patch, manage and secure your server
    • Managed ITHelp desk, remote support and device management. Quoted per business.
    • Networks & On-siteNetwork installs, Wi-Fi, cameras and security reviews.
    • Web Design & AppsWebsites and custom business software
  • Locations
  • Guides
  • Status
  • Contact
Customer Portal

Guides / Getting Started

Initial Server Setup with Ubuntu 24.04

The first things to do on a new Linux VPS: create your own user, turn on the firewall, log in with an SSH key and keep it updated.

Getting StartedBeginner15 minUbuntu 24.04SSHSecurity

In this guide

  1. What you’ll need
  2. Log in as root
  3. Install the latest updates
  4. Create your own user
  5. Turn on the firewall
  6. Set up an SSH key
  7. Turn off password and root logins
  8. Turn on automatic security updates
  9. What’s next?

You’ll need a Linux VPS running Ubuntu 24.04. Ours start at CA$6.99/mo in Halifax.

See VPS plans

A brand-new Linux server arrives with just one account — root, the all-powerful administrator — protected by a single password. That’s fine for the first few minutes, but it’s not safe to leave that way. In about 15 minutes this guide gives you your own everyday user, a firewall, a much safer key-based login and automatic security updates. Do this first, before you install anything else. No experience needed — you’ll copy and paste every command, and after each one we’ll show you exactly what you should see.

Fresh VPS •  root login only •  password only •  no firewall This guide about 15 min Your secured VPS •  your own user + sudo •  SSH-key login •  firewall on •  auto security updates
What changes: you’ll turn a fresh server into one that’s locked down and ready for real work.

What you’ll need

  • A Linux VPS running Ubuntu 24.04. Don’t have one yet? Grab one above — it’s ready in a couple of minutes.
  • Your server’s IP address and root password. Both are in your welcome email and in the Customer Portal.
  • A terminal on your own computer — just a window where you type commands:
    • Windows: open PowerShell (press Start, type PowerShell, press Enter).
    • Mac: open Terminal (press Cmd + Space, type Terminal, press Enter).
    • Linux: open your Terminal app.
The Server Information panel in the SableServers Customer Portal, showing the hostname, IP address, operating system, masked root password and SSH port.
In the Customer Portal, open your VPS and the Server Information panel shows your IP address and root password (click the eye icon to reveal it).

Two rules for the whole guide: wherever you see your_server_ip, type your own IP address instead (it looks like 203.0.113.42). And wherever you see sam, use whatever username you’d like for yourself — we just picked sam as an example.

1Step 1: Log in as root

Open your terminal (PowerShell on Windows, Terminal on Mac/Linux), type the line below with your own IP in place of your_server_ip, and press Enter:

Your computer
$ ssh root@your_server_ip

The very first time, it asks whether you trust this server:

What you’ll see
The authenticity of host '203.0.113.42' can't be established.
ED25519 key fingerprint is SHA256:a1b2c3d4e5f6...
Are you sure you want to continue connecting (yes/no/[fingerprint])?

Type yes and press Enter. Next it asks for your password — type or paste your root password and press Enter.

The screen stays blank while you type the password — that’s normal.

For security the terminal shows nothing, not even dots. Just type it and press Enter.

You’re in when the start of the line changes to something like this — it means you’re now typing commands on your server:

What you’ll see
root@your-server:~#

2Step 2: Install the latest updates

First, bring the server fully up to date so you start from a clean, patched system. Copy this, press Enter, and give it a minute — it prints a lot of text and finishes back at the # prompt:

Your server
$ apt update && apt upgrade -y
If it says a restart is needed.

Run reboot, wait about a minute, then log in again with the same ssh root@your_server_ip command from Step 1.

3Step 3: Create your own user

Working as root all the time is risky — one wrong command can wipe the whole system. Instead you’ll make a normal user for day-to-day work and give it admin powers through sudo (you type sudo in front of a command only when you actually need admin rights). Create the user:

Your server
$ adduser sam

It asks you to set a password, then a few optional details:

What you’ll see
Adding user `sam' ...
Creating home directory `/home/sam' ...
New password:
Retype new password:
...
Full Name []:
Room Number []:
...
Is the information correct? [Y/n]

Choose a strong password (nothing shows while you type it, same as before). For Full Name and the other questions you can just press Enter to leave them blank, then press Y and Enter to confirm. Now give sam admin rights:

Your server
$ usermod -aG sudo sam

This command prints nothing, which means it worked.

4Step 4: Turn on the firewall

A firewall decides what’s allowed to reach your server. Ubuntu includes a simple one called UFW. We’ll make sure it’s installed, switch it on, and — importantly — allow SSH first, so you don’t lock yourself out:

Your server
$ apt install -y ufw
$ ufw allow OpenSSH
$ ufw enable

When it warns that this may disrupt existing connections, type y and press Enter.

Always allow OpenSSH before you enable the firewall.

If you turn the firewall on without allowing SSH, the next thing it blocks is you — and you’ll be locked out of your own server.

Check what’s now allowed:

Your server
$ ufw status
What you’ll see
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)

Later, when you install something like a website or a game server, you open its port the same way — for example ufw allow 80/tcp for a website.

5Step 5: Set up an SSH key

An SSH key is a pair of files — a public one that lives on the server and a private one that stays on your computer. Together they let you log in without typing a password, and they’re far harder to break than any password. These commands run on your own computer, not the server, so open a new terminal window and pick your system:

Make a key. Press Enter at each question to accept the defaults; a passphrase is optional but recommended:

Your computer
$ ssh-keygen -t ed25519
What you’ll see
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/you/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
...
Your identification has been saved in /home/you/.ssh/id_ed25519

Now copy the key to the server. Enter sam’s password when asked (this is the last time you’ll need it):

Your computer
$ ssh-copy-id sam@your_server_ip
What you’ll see (it ends with)
Number of key(s) added: 1

In PowerShell, make a key. Press Enter at each question to accept the defaults; a passphrase is optional but recommended:

PowerShell on your computer
ssh-keygen -t ed25519
What you’ll see
Generating public/private ed25519 key pair.
Enter file in which to save the key (C:\Users\you/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
...
Your identification has been saved in C:\Users\you/.ssh/id_ed25519

Now copy the key to the server with the line below (paste it exactly). Enter sam’s password when asked:

PowerShell on your computer
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh sam@your_server_ip "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Now test it. Log in as your new user:

Your computer
$ ssh sam@your_server_ip

It should log you straight in without asking for sam’s password (if you set a passphrase on the key, it asks for that instead). You’ll land at sam’s prompt — note the $ instead of #, which shows you’re a normal user now:

What you’ll see
sam@your-server:~$

6Step 6: Turn off password and root logins

Your key works, so there’s no reason to let anyone log in with a password or as root anymore — turning both off stops the constant automated password-guessing that every public server gets. Logged in as sam, open a new settings file:

Your server (as sam)
$ sudo nano /etc/ssh/sshd_config.d/00-sable-hardening.conf

nano is a simple text editor right in the terminal. The first time you use sudo it may ask for sam’s password. Type these two lines into the empty file:

00-sable-hardening.conf
PasswordAuthentication no
PermitRootLogin no

Save and close: press Ctrl + O then Enter to save, then Ctrl + X to exit. Check the settings are valid, then apply them:

Your server (as sam)
$ sudo sshd -t
$ sudo systemctl restart ssh

If sshd -t prints nothing at all, your settings are fine — silence is success here. (If it prints an error, reopen the file and check the two lines match exactly.)

Keep this window open and test in a new one first.

Open a second terminal and run ssh sam@your_server_ip. Only close this original window once that new login works. If anything went wrong, you’re still logged in here and can fix it.

7Step 7: Turn on automatic security updates

Finally, let the server install security fixes by itself so you don’t have to remember to. As sam, run:

Your server (as sam)
$ sudo apt install -y unattended-upgrades
$ sudo dpkg-reconfigure -plow unattended-upgrades

A blue full-screen box appears asking “Automatically download and install stable updates?” — use the arrow keys if needed to highlight <Yes> and press Enter. That’s it: your server now installs security updates on its own, every day.

What’s next?

Your server is secured and ready for real work. From now on, always log in as sam (ssh sam@your_server_ip) and put sudo in front of admin commands. A great first project: host a Minecraft server for you and your friends. If you get stuck on any step, our team in Nova Scotia is on the help desk and Discord.

Start with a server you can trust

Canadian Linux VPS with full root access, in Halifax and Montreal.

See VPS plans

More guides

How to Host a Minecraft Server on a Linux VPS

Prices shown in your currency are approximate. We bill in Canadian dollars.

Newsletter

New locations, deals and service news. About once a month.

Marketing email from Sable Servers Ltd. Confirm by email, unsubscribe any time. Privacy

Sable Servers Sable Servers

Built stable. That’s Sable.

Hosting

  • Game Servers
  • Cloud Compute (VPS)
  • Object Storage
  • Web Hosting
  • Managed Servers

Business

  • Managed IT
  • Networks & On-site
  • Web Design & Apps

Company

  • About Us
  • Locations
  • Status
  • Customer Portal

Contact

  • Email Us
  • Help Desk
  • Guides
  • FAQ
  • Discord

© 2026 Sable Servers Ltd. All rights reserved.

Terms of Service | Acceptable Use Policy | Privacy Policy |

Cookies

Necessary cookies keep this site running. If you allow it, we also use analytics and ad cookies and share visit and order data with Google and Meta, also from our servers, to measure our ads, here and in our store. They may process it outside Canada.

Privacy policyCookie details