Start a Python Script in Virtual Environnment at Boot

Tested on Synology

This example is to automatically start at boot the python script created in this post

Change directory

cd /etc/systemd/system

Create the service file

sudo nano flask_test_server.service

copy & paste below

Description=<project flask_test_server>



Reload the service files to include the new service

sudo systemctl daemon-reload

Start the service

sudo systemctl start flask_test_server.service

Check the status of the service

sudo systemctl status flask_test_server.service

check also here

Enable the service on every reboot

sudo systemctl enable flask_test_server.service

Et voilĂ …..