Skip to content

Ubuntu start software on system boot

Configure systemd services

The Linux system uses systemd as the startup server management mechanism. First, copy the executable file to the /usr/local/bin directory, and copy the relevant configuration to the /etc directory.

sudo cp your_exe_file /usr/local/bin
sudo cp your_config_file /etc/

Create systemd service configuration file.

sudo vim /etc/systemd/system/your_exe_name.service

Add following lines.

[Unit]
Description=your_exe_description(could be any thing you like)
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/your_exe_file -d /etc/your_config_file

[Install]
WantedBy=multi-user.target

Enable Service

Use the following command to make your program start automatically on boot.

sudo systemctl enable your_exe_name

Then, start your program.

sudo systemctl start your_exe_name

View program status.

sudo systemctl status your_exe_name
Leave a Reply