Last Edited: 8/9/2024
Please note I placed my directory I am using for the packages at /opt/packages
This presumes you have install pypiserver. If you didn’t it is done with:
pip install pypiserver
This can build your system service entry.
cat <<EOF | sudo tee /etc/systemd/system/pypiserver.service
[Unit]
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/pypi-server run -p 8080 /opt/packages
WorkingDirectory=/opt/packages
TimeoutStartSec=3
[Install]
WantedBy=multi-user.target
EOF
Remember you will need to reload system daemon.
sudo systemctl daemon-reload
The service may be started in the following fashion.
sudo systemctl start pypiserver
When checking status
systemctl status pypiserver
PRO TIP: And you might want to remember to “enable” the service so that it automatically starts when the server is restarted
systemctl enable pypiserver.service