After the mixnode is setup and can run well, we can run it as a service.
# export node name
monikor=AnyNodes
# Create service file
sudo tee /etc/systemd/system/nym-node.service > /dev/null <<EOL
[Unit]
Description=Nym Node
StartLimitInterval=350
StartLimitBurst=10
[Service]
User=$USER
ExecStart=$HOME/nym/nym-node run --id $monikor --deny-init --mode mixnode
Restart=on-failure
RestartSec=30
LimitNOFILE=65535
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
EOL
# Start service
systemctl daemon-reload
systemctl enable nym-node.service
service nym-node start
# Check service log
journalctl -u nym-node -f