Skip to content

Cookie settings

Choose which kinds of cookies you allow. You can change your choice at any time via Cookie settings at the bottom of every page. Privacy statement

Necessary

Always on

Needed to log in, keep your cart and remember your choices. These are always on.

Which cookies?
  • weboke_sessie, weboke_klant, weboke_remember: your session and staying logged in
  • weboke_basket: your cart
  • wkBtwIncl: showing prices with or without VAT
  • wok_cookies: your cookie choice, 12 months

Measures which ad leads to a visit or order, so we do not pay for ads that do nothing.

Which cookies?
  • Google Ads via Google Tag Manager (_gcl_au, _gcl_aw), up to 90 days
  • OpenAI Ads, ads in ChatGPT
  • wok_aff: which partner referred you to us (affiliate programme), 60 days

4.6

Country and language

Each country has its own site, with prices and VAT for that country.

View

Managing services with systemctl on your VPS

Your VPS runs programs that always need to be there: the SSH server, a web server, a database. These programs are called services. On Debian, Ubuntu, AlmaLinux and Rocky Linux, systemd starts and monitors them, and you control systemd with the systemctl command. These are the commands you'll need most often.

The status of a service

systemctl status nginx

You can leave out the .service extension. Read the output from top to bottom:

  • The dot in front of the name is green if the service is running, white if it has stopped and red if it has failed.
  • Loaded tells you whether the service starts at boot (enabled) or not (disabled).
  • Active tells you whether it is running right now (active (running)), has stopped (inactive (dead)) or has failed (failed), and since when.
  • At the bottom you'll find the last lines from the service's log. Often that already tells you why something is going wrong.

Starting, stopping and reloading

CommandWhat it does
sudo systemctl start nginxStart now
sudo systemctl stop nginxStop now
sudo systemctl restart nginxStop and start again
sudo systemctl reload nginxReread the configuration without stopping

The difference between restart and reload matters. With a restart, the service stops briefly, and if there's an error in the new configuration, it won't start again and your website is down. With a reload, the service keeps running; if there's an error, nginx keeps the old configuration. So always test the configuration first (sudo nginx -t, sudo sshd -t) and then use reload. Not every service supports reload; sudo systemctl reload-or-restart picks the right one for you.

At boot: enable and disable

Starting a service and "starting it at boot" are two different things. If you only start a service with start, it will be gone again after the next reboot, for example after a kernel update.

CommandWhat it does
sudo systemctl enable --now nginxStart now and from now on at boot. Use this for a new service
sudo systemctl disable --now nginxStop now and no longer start at boot
systemctl is-enabled nginxShows whether the service starts at boot

What's wrong? And what's running?

systemctl --failed

This shows all failed services. The list should be empty. Check it after every reboot and every upgrade. Once you've fixed the problem, clear the message with sudo systemctl reset-failed.

  • systemctl list-units --type=service --state=running shows all running services. If you don't recognise one, find out what it does. A service you don't need is an unnecessary way in.
  • systemctl list-timers shows systemd's scheduled tasks, with when they last ran and when they'll run next. This lets you see, for example, whether the timers for automatic updates or certificate renewal are running.

The logs of a service

Want to see more than the few lines in systemctl status? Use journalctl:

sudo journalctl -u nginx --since "1 hour ago"
sudo journalctl -u nginx -p err -b

The first shows everything from nginx in the past hour, the second only the errors since the last reboot. You'll find more commands in Reading logs with journalctl and docker logs.

Changing the settings of a service

Never edit a package's unit file (in /usr/lib/systemd/system/), because an update will overwrite it. Use sudo systemctl edit nginx instead: it creates a small file containing only your changes and makes systemd reread it. You can see what ultimately applies with systemctl cat nginx.

It's better to restart your whole server cleanly with sudo systemctl reboot, or with Restart in the VPS screen. Force off is like pulling the plug: services don't get a chance to stop cleanly and a database can get corrupted. See The VPS screen: on and off, graphs, system and log.

On AlmaLinux and Rocky Linux, systemctl works exactly the same way, but some services have different names: the SSH service is called sshd instead of ssh, Apache is called httpd and the firewall is firewalld.

Want to learn more? Take the free course VPS and Linux server management, lesson 6.1 Managing services with systemd or lesson 6.2 Reading logs with journalctl.

Was this article helpful?

← Back to VPS hosting

One moment…

Set up your domains

For each domain, arrange the nameservers, the link to your hosting and who becomes the owner.

Loading your domains…