Production & Daemon

February 17, 2026 ยท View on GitHub

Background Process

nohup go run magento.go > output.log 2>&1 &

Or with binary:

go build -o magento
nohup ./magento > output.log 2>&1 &

systemd Service

Create /etc/systemd/system/magento.service:

[Unit]
Description=Magento Go API

[Service]
ExecStart=/path/to/magento
WorkingDirectory=/path/to/gogento-catalog
Restart=always
User=youruser
Environment=PORT=8080

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start magento
sudo systemctl enable magento