# Run UxPlay as a systemd service

<span style="white-space: pre-wrap;">This method gives you:</span>

- <span style="white-space: pre-wrap;">**systemctl start uxplay**</span>
- <span style="white-space: pre-wrap;">**systemctl stop uxplay**</span>
- <span style="white-space: pre-wrap;">**systemctl restart uxplay**</span>
- <span style="white-space: pre-wrap;">Optional **auto‑start on boot**</span>
- <span style="white-space: pre-wrap;">Clean background operation with no terminal needed</span>

#### <span style="white-space: pre-wrap;">Create a systemd service file</span>

1. <span style="white-space: pre-wrap;">Open Service file</span>

```bash
sudo nano /etc/systemd/system/uxplay.service
```

<span style="white-space: pre-wrap;">In Nano Paste following command editing yoursuername</span>

```bash
[Unit]
Description=UxPlay AirPlay Receiver
After=network.target

[Service]
Type=simple
User=YOURUSERNAME
ExecStart=/usr/bin/uxplay
Restart=on-failure

[Install]
WantedBy=multi-user.target
```

2. <span style="white-space: pre-wrap;">Reload systemd</span>

```bash
sudo systemctl daemon-reload
```

Optional: Enable auto start on boot

```bash
sudo systemctl enable uxplay
```

#### Systemd Commands for UxPlay

- Start

```bash
sudo systemctl start uxplay
```

- Stop

sudo systemctl stop uxplay

```bash
sudo systemctl stop uxplay
```