Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Latest commit

 

History

History
31 lines (20 loc) · 1.43 KB

File metadata and controls

31 lines (20 loc) · 1.43 KB

If your server doesn't automaticaly start when the OS boots, it can be a concern. If the machine reboots for some reason, you could notice it only after quite some time.
It's also just convenient to have the server starting automaticaly when the machine (re)boots.

Let's handle this simply, using cron.

In this tutorial, I assume you use a start script to start your server. Here I'll be using a start script that uses tmux, covered in this tutorial.

First, let's ensure the crontab command is available, enter:

  1. sudo apt update -y
  2. sudo apt install cron -y

Now, enter crontab -e.
If it's the first time you enter this command, you will be asked to choose a text editor, I recommend nano.
If you've never used nano before, see notes here.

Now, go at the end of the file, and add this line:

@reboot /home/raph/myserver/startbackground.sh

Modify it for your own path.
It should look like this:

Screenshot 2026-02-25 020833

Save and close nano.

Now you should restart your Linux to verify: enter sudo reboot.
Wait a bit, then try to connect to your server.