Your First Hour on a Linux Server: Essential Commands Checklist

Your First Hour on a Linux Server: Essential Commands Checklist Checklists & Cheat Sheets

Getting access to a new VPS is only the beginning. Before installing a website, Docker, database, VPN, or any production application, you should spend a few minutes preparing and securing the server.

This Linux server checklist walks you through the essential tasks to complete during your first hour on a new Linux VPS.

The commands below are primarily intended for Ubuntu and Debian-based servers, although many of them also work on other Linux distributions.

By the end of this guide, you will have:

  • connected to your server using SSH;
  • checked the operating system and server resources;
  • updated installed packages;
  • created a separate administrator account;
  • configured sudo access;
  • prepared SSH key authentication;
  • enabled a basic firewall;
  • checked listening ports and running services;
  • configured automatic security updates;
  • verified that your server is ready for the next step.

Important: Keep your existing root SSH session open while changing SSH or firewall settings. Open a second terminal and verify that the new configuration works before disconnecting the original session.


Linux Server First-Hour Checklist

Before going into detail, here is the complete checklist.

  • Connect to the VPS using SSH
  • Check the Linux distribution and version
  • Check CPU, RAM, disk space, and network interfaces
  • Update the package database
  • Install available updates
  • Set the correct hostname
  • Set the correct timezone
  • Create a non-root administrator
  • Configure sudo access
  • Add an SSH public key
  • Test the new SSH login
  • Configure the firewall
  • Check open ports
  • Review running services
  • Enable automatic security updates
  • Reboot if required
  • Verify that everything works

Now let’s complete each step.

1. Connect to Your Linux Server Using SSH

Your hosting provider will normally give you at least three pieces of information:

  • server IP address;
  • username, often root;
  • password or SSH key.

On Linux, macOS, and modern Windows systems, you can connect from a terminal.

Run:

ssh root@SERVER_IP

Replace SERVER_IP with the IP address of your VPS.

For example:

ssh root@203.0.113.10

The first time you connect, SSH may display a message asking whether you trust the server’s host key.

After verifying the fingerprint through a trusted source when available, accept it and continue.

You should then see a command prompt on the remote server.

Check Who You Are Logged In As

Run:

whoami

If you logged in using the default administrator account, the result may be:

root

You now have administrative access to the server.


2. Check Your Linux Version

Before installing software or following tutorials, find out exactly which Linux distribution is running.

Use:

cat /etc/os-release

On an Ubuntu server, you may see information similar to:

NAME="Ubuntu"
VERSION="26.04 LTS"
ID=ubuntu

You can also check the kernel:

uname -r

Or display more system information:

uname -a

Knowing the distribution and version is important because package names, repositories, configuration locations, and firewall tools can differ between Linux distributions.


3. Check CPU, RAM, and Disk Space

Before configuring the server, confirm that the VPS resources match what you ordered.

Check CPU

Run:

lscpu

For a quick CPU count:

nproc

Check RAM

Run:

free -h

The -h option displays memory in a human-readable format.

Example:

               total        used        free
Mem:           3.8Gi       420Mi       3.0Gi
Swap:          1.0Gi          0B       1.0Gi

Check disk space

Run:

df -h

Pay particular attention to the filesystem mounted at /.

You can also inspect disks and partitions with:

lsblk

These simple checks can catch provisioning mistakes before you start deploying applications.


4. Check the Server’s IP Addresses

Run:

ip addr

For a shorter overview:

ip -br addr

To inspect the routing table:

ip route

This becomes especially useful later when configuring Docker networks, VPNs, additional IP addresses, or multiple network interfaces.


5. Update the Linux Server

A newly created VPS may have been installed from an image that is already several days or weeks old.

Updating the system should therefore be one of your first actions.

On Ubuntu or Debian:

apt update

Then install available upgrades:

apt upgrade -y

You can combine them:

apt update && apt upgrade -y

After the process finishes, check whether a reboot is required:

test -f /var/run/reboot-required && echo "Reboot required"

Don’t reboot yet if you are still configuring remote access. Finish and test your SSH configuration first.


6. Set the Server Hostname

A meaningful hostname makes servers easier to identify, especially when you eventually manage multiple machines.

Check the current hostname:

hostnamectl

Set a new one:

hostnamectl set-hostname web01

For example, you might use names such as:

web01
db01
vpn01
docker01

For a public server, you may instead use a fully qualified hostname such as:

server1.example.com

Check the result:

hostname

7. Set the Correct Timezone

Check the current time configuration:

timedatectl

List available timezones:

timedatectl list-timezones

For example, to use UTC:

timedatectl set-timezone UTC

Then verify:

timedatectl

UTC is often a convenient choice for servers because it simplifies logs and monitoring across different regions.


8. Create a Non-Root Administrator

Using root for every administrative task is generally unnecessary.

Create a separate user:

adduser admin

Replace admin with your preferred username.

The system will ask you to create a password and optionally enter additional information.

Now add the user to the sudo group:

usermod -aG sudo admin

Verify the groups:

groups admin

You should see sudo in the output.


9. Test Sudo Access

Switch to the new account:

su - admin

Then run:

sudo whoami

After entering the user’s password, the expected result is:

root

That means the account can perform administrative tasks without requiring you to work permanently as root.

Return to the original shell if needed:

exit

10. Configure SSH Key Authentication

Passwords can be attacked through automated login attempts. SSH keys provide a stronger and more convenient authentication method when configured correctly.

On your local computer, generate a key if you do not already have one:

ssh-keygen -t ed25519

In most cases, accepting the default location is fine.

Your public key will normally be stored at:

~/.ssh/id_ed25519.pub

You can copy it to the server with:

ssh-copy-id admin@SERVER_IP

Then test the connection:

ssh admin@SERVER_IP

Do not disable password or root authentication until this login works successfully.


11. Test Your New SSH Account

This step is extremely important.

Keep your current root connection open.

Open another terminal window and connect using the new account:

ssh admin@SERVER_IP

Then test sudo:

sudo whoami

You should receive:

root

Only continue with SSH hardening after confirming that both login and sudo access work.

This prevents one of the most common beginner mistakes: locking yourself out of your own VPS.


12. Review Your SSH Configuration

The OpenSSH server configuration is commonly located at:

/etc/ssh/sshd_config

Before changing it, create a backup:

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup

Edit it with your preferred editor:

sudo nano /etc/ssh/sshd_config

If you plan to disable direct root login, you can configure:

PermitRootLogin no

If you have successfully tested SSH key authentication and deliberately want to disable password authentication:

PasswordAuthentication no

Before reloading SSH, validate the configuration:

sudo sshd -t

If the command returns no errors, reload the SSH service:

sudo systemctl reload ssh

Do not close your existing SSH connection yet.

Open another terminal and confirm that you can still log in.


13. Configure a Basic Firewall

A firewall reduces unnecessary network exposure.

Ubuntu commonly uses UFW as a convenient interface for firewall management.

Check whether it is installed:

sudo ufw status

Before enabling the firewall, allow SSH:

sudo ufw allow OpenSSH

Then enable it:

sudo ufw enable

Check the result:

sudo ufw status verbose

You should see SSH allowed.

If You Will Run a Web Server

For HTTP:

sudo ufw allow 80/tcp

For HTTPS:

sudo ufw allow 443/tcp

Then check again:

sudo ufw status

Only expose ports that you actually need.


14. Check Listening Ports

You should know which services are accessible from the network.

Run:

sudo ss -tulpn

This displays listening TCP and UDP sockets and the processes associated with them.

On a freshly installed server, you may initially see SSH listening on port 22.

Later, after installing a web server, you may also see:

:80
:443

Unexpected listening services deserve investigation.

You don’t need to panic simply because you see an unfamiliar port, but you should understand why it is open.


15. Check Running Services

List running systemd services:

systemctl --type=service --state=running

You can inspect a particular service with:

systemctl status ssh

Other common examples include:

systemctl status nginx
systemctl status apache2
systemctl status docker
systemctl status mysql

Of course, these services will only exist after the corresponding software has been installed.

Understanding systemctl early will make Linux administration significantly easier.


16. Enable Automatic Security Updates

Security patches are important on Internet-facing servers.

On Ubuntu and Debian, install the unattended-upgrades package if it is not already available:

sudo apt install unattended-upgrades -y

Then configure it:

sudo dpkg-reconfigure unattended-upgrades

You can inspect its configuration under:

/etc/apt/apt.conf.d/

Automatic security updates do not replace proper server maintenance, but they can reduce the amount of time a known vulnerability remains unpatched.

For critical production systems, you should still have a controlled update, monitoring, backup, and rollback strategy.


17. Check Available Swap

Run:

swapon --show

And:

free -h

Some VPS images are provisioned without swap.

That isn’t automatically a problem. Whether you need swap depends on available RAM, workload, storage, and your performance requirements.

Small VPS instances running several services may benefit from having some swap available as protection against sudden memory pressure.

Do not treat swap as a substitute for sufficient RAM.


18. Check System Logs

Learning where to look when something fails is one of the most useful Linux administration skills.

View recent system messages:

journalctl -p warning -b

To inspect SSH logs:

journalctl -u ssh

To follow a service log in real time:

journalctl -u ssh -f

You can also inspect recent kernel messages:

dmesg | tail

Not every warning indicates a serious problem. The goal at this stage is simply to become familiar with your server’s current state.


19. Install a Few Useful Administration Tools

Minimal VPS images sometimes exclude tools administrators commonly use.

You can install a basic toolkit with:

sudo apt install curl wget git nano vim htop unzip zip dnsutils net-tools -y

You may not need every package, but several are extremely useful.

For example:

htop

provides an interactive view of CPU and memory usage.

And:

curl ifconfig.me

can quickly show the public IPv4 address used for an outbound connection.


20. Reboot and Perform a Final Check

If updates installed a new kernel or the system reports that a reboot is required, reboot the server:

sudo reboot

Your SSH connection will close.

Wait for the VPS to boot and reconnect:

ssh admin@SERVER_IP

Then perform a quick final check:

uptime
free -h
df -h
sudo ufw status
sudo ss -tulpn
systemctl --failed

The last command is particularly useful:

systemctl --failed

Ideally, it should not show unexpected failed services.


Final Linux Server Checklist

Before you start installing applications, confirm the following:

Access

  • SSH connection works
  • Non-root administrator created
  • sudo works
  • SSH key authentication works
  • A backup SSH session was used when testing configuration changes

System

  • Linux version checked
  • CPU and RAM checked
  • Disk space checked
  • Packages updated
  • Hostname configured
  • Timezone configured

Security

  • Firewall enabled
  • SSH allowed through the firewall
  • Unnecessary ports are not exposed
  • SSH configuration reviewed
  • Automatic security updates configured

Monitoring

  • Running services reviewed
  • Listening ports reviewed
  • Logs checked
  • Failed systemd services checked
  • Swap configuration checked

If you can check all of these boxes, your new Linux VPS has a much better foundation for whatever you plan to deploy next.

What Should You Install Next?

That depends on what the server is going to do.

For a web server, your next steps might include installing Nginx, PHP, a database, and HTTPS certificates.

For container hosting, you may want to install Docker and Docker Compose.

For a VPN server, the next step might be WireGuard.

For application hosting, you may need Node.js, Python, PostgreSQL, Redis, or another application stack.

But the principle is the same:

Secure and understand the base system before adding applications to it.

Your first hour on a Linux server is not about installing as much software as possible. It is about creating a clean, secure, and understandable foundation that will make everything you do afterward easier.

Оцените статью
Добавить комментарий