Skip to content

Linux Remote Access

Enable secure remote streaming from your Linux server.

  1. Open Plex Web: http://localhost:32400/web
  2. SettingsRemote Access
  3. Enable manual port: 32400
  4. Click Retry
Terminal window
sudo ufw allow 32400/tcp
sudo ufw allow 32410:32414/udp
sudo ufw status
Terminal window
sudo firewall-cmd --permanent --add-port=32400/tcp
sudo firewall-cmd --permanent --add-port=32410-32414/udp
sudo firewall-cmd --reload
Terminal window
sudo iptables -A INPUT -p tcp --dport 32400 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 32410:32414 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Configure your router:

  • External Port: 32400
  • Internal Port: 32400
  • Protocol: TCP
  • IP: Your server’s IP
Terminal window
# Find your IP
ip addr show | grep "inet " | grep -v 127.0.0.1
Terminal window
sudo apt install ddclient
sudo nano /etc/ddclient.conf
protocol=duckdns
use=web, web=checkip.dyndns.org
server=www.duckdns.org
login=your-token
password=
your-domain.duckdns.org
Terminal window
sudo systemctl enable ddclient
sudo systemctl start ddclient
server {
listen 443 ssl;
server_name plex.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/plex.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/plex.yourdomain.com/privkey.pem;
location / {
proxy_pass http://localhost:32400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Terminal window
# Local
nc -zv localhost 32400
# External (use online port checker)
curl -I http://YOUR_PUBLIC_IP:32400