1. Open new service file: ``` sudo nano /etc/systemd/system/.service ``` 2. Content ``` [Unit] Description=Page Host Service After=network.target [Service] User=your_username WorkingDirectory=/home/your_username/repo/asobi Environment=PYENV_ROOT=/home/your_username/.pyenv ExecStart=/bin/bash -c "source $PYENV_ROOT/bin/pyenv && pyenv activate pyenv && python page_host.py" Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ``` 3. Reload systemd, enable service: ``` sudo systemctl daemon-reload sudo systemctl enable .service sudo systemctl start .service ``` 4. Check status: ``` sudo systemctl status .service journalctl -u .service ``` 5. Test reboot: ``` sudo reboot ``` Check status ``` sudo systemctl status page_host.service ```