Closed SeanIFitch closed 1 month ago
For ubuntu: Create a systemd Service File:
Create a new file in /etc/systemd/system/, for example myapp.service, with the following content (edit paths and names accordingly):
[Unit] Description=Start My Python App at boot
[Service] ExecStart=/usr/bin/python3 /path/to/your/script.py
[Install] WantedBy=multi-user.target Enable the Service:
Run sudo systemctl enable myapp.service to enable the service. Optionally, start it immediately with sudo systemctl start myapp.service.
For ubuntu: Create a systemd Service File:
Create a new file in /etc/systemd/system/, for example myapp.service, with the following content (edit paths and names accordingly):
[Unit] Description=Start My Python App at boot
[Service] ExecStart=/usr/bin/python3 /path/to/your/script.py
[Install] WantedBy=multi-user.target Enable the Service:
Run sudo systemctl enable myapp.service to enable the service. Optionally, start it immediately with sudo systemctl start myapp.service.