Essential system settings
A handful of one-time gestures: user, automatic updates, smart swap (zram), and the basic tools. The machine becomes clean and stable.
In this guide
Guide checked 3 months ago: some commands may have changed. Let us know if so.
In short
After installing Ubuntu, four settings are enough for a clean, stable machine: install the basic toolkit (build-essential, git, curl, htop, tmux), give the machine a short name with hostnamectl, enable zram for compressed swap in RAM (zram-tools package, PERCENT=50) and check that automatic security updates (unattended-upgrades) are on. A quick look at timedatectl confirms the time zone. From then on, the coding agent can repeat these steps for you.
Do this first: Installing Linux
Ubuntu is installed. It works. But a fresh machine is an empty apartment: it stands up, but the furniture and the running water are missing. A quarter-hour of setup now, and the machine becomes clean, stable, and pleasant to live with, for years.
We’ll do all of this by hand once, to understand it. And you’ll see at the end: next time, you’ll let the agent handle it.
Update and lay down the basic tools
First, we make sure everything is up to date, then we install the toolkit we’ll use in every guide that follows.
# Always start by refreshing and updating
sudo apt update && sudo apt upgrade -y
# The basic kit: compiler, git, curl, system monitor, terminal multiplexer
sudo apt install -y build-essential git curl htop tmux
What each one gives you:
- build-essential: the C compiler and the tools many programs require to install. You lay it down once and never think about it again.
- git: version control. Indispensable the moment you touch code.
- curl: to download files and test servers from the terminal.
- htop: a readable system monitor (CPU, RAM, processes). Type
htopand watch your machine breathe in real time. - tmux: the terminal multiplexer. The most valuable one for remote work.
Give the machine a name
The name suggested by the installer is often long and not very telling. Let’s give it a short, clear name, handy as soon as you have several, or to connect over SSH.
# Rename the machine to "mini" (pick whatever name you like)
sudo hostnamectl set-hostname mini
The change is immediate; the new name will show up fully the next time you open a terminal.
Configure your git identity
Git wants to know who signs the commits. Set it once and for all, globally.
# Your name and email will appear on every commit
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
zram: a smart swap
Here’s the setting few people know about that changes everything on a small machine.
Swap is RAM’s safety valve: when physical memory is full, the system overflows onto the disk. Classic swap writes to the SSD, it’s slow, and it wears the SSD down over time.
zram does better: it creates a swap compressed directly in RAM. Instead of writing to disk, it compresses the data in memory (often 2 to 3× smaller). The result: it’s far faster than disk swap, it protects against memory crashes (the OOM, that moment when the system kills a program for lack of RAM, typically when you load a big AI model), and it spares the SSD.
0 of 2 steps done Your ticks stay in this browser.
-
Install zram-tools
# The package that manages RAM-compressed swap sudo apt install -y zram-tools -
Set the size of the compressed swap
Open the config file and set the proportion of RAM allocated. The value
PERCENT=50(half your RAM) is a good starting point.# Edit the configuration (nano is the simplest editor) sudo nano /etc/default/zramswapFind the
PERCENTline and set:PERCENT=50Save with Ctrl + O, then quit with Ctrl + X. Restart the service to apply:
sudo systemctl restart zramswap
Automatic security updates
A machine running 24/7 should patch itself. Good news: Ubuntu installs and enables unattended-upgrades out of the box, the tool that applies security fixes without you thinking about it. We just make sure it’s there and switched on.
# Install the tool if it's missing (otherwise apt says it's already there)
sudo apt install -y unattended-upgrades
# Enable it via the wizard (answer "Yes")
sudo dpkg-reconfigure --priority=low unattended-upgrades
# Check: both settings should be set to "1"
cat /etc/apt/apt.conf.d/20auto-upgrades
Check the time and the language
A quick check: the clock and the locale. A wrong time breaks certificates and skews logs, so it’s worth verifying.
# Show timezone, system time, and sync status
timedatectl
If the timezone is wrong, fix it:
# Example for mainland France
sudo timedatectl set-timezone Europe/Paris
The machine is now clean, named, up to date, and shielded against memory spikes. The kind of foundation you lay once and forget.
All the commands in this guide
Frequently asked questions
What is zram for on Ubuntu?
zram creates compressed swap directly in RAM instead of writing to the SSD, and data there often takes up 2 to 3 times less space. It is much faster than disk swap, it stops the system from killing a program for lack of memory, typically when loading a large AI model, and it spares the SSD.
Why use tmux on a remotely managed machine?
tmux creates terminal sessions that survive disconnection. If your SSH connection drops mid-task, because of Wi-Fi, a flat battery or a cut tunnel, the task keeps running on the machine and you find it intact when you reconnect.
How do you check that automatic security updates are on in Ubuntu?
Ubuntu normally installs and enables unattended-upgrades out of the box. To confirm, run sudo dpkg-reconfigure --priority=low unattended-upgrades and answer 'Yes', then display the file /etc/apt/apt.conf.d/20auto-upgrades: both settings should be set to 1.
How do you rename an Ubuntu machine?
With sudo hostnamectl set-hostname followed by the new name, for example mini. The change is immediate, and the new name shows up fully the next time you open a terminal. A short, clear name makes SSH connections easier and helps you tell machines apart once you have several.
Why does the machine's clock need to be right?
A wrong time breaks certificates and skews logs. The timedatectl command shows the time zone, system time and sync status; if the time zone is wrong, sudo timedatectl set-timezone Europe/Paris fixes it for mainland France.
Terms in this guide: UbuntuAgentGitRAMtmuxSSHCommit
Spotted a mistake?
A command stopped working, a price changed?
Tools change every month. Tell me what is wrong in this chapter and I will fix it and update its date.