Emby is a powerful open-source media server alternative to Plex, supporting various operating systems such as Linux, FreeBSD, Windows, and macOS. Accessible from multiple devices, it offers flexibility for users to enjoy their media anywhere. This guide focuses on installing the Emby Media Server on Debian 12, featuring Nginx as a reverse proxy and enabling UFW for enhanced security.
**Summary**: Learn how to self-host the Emby Media Server on Debian 12 using Nginx as a reverse proxy. This guide covers installation, configuration, and security measures to help you create a robust and secure media server. Perfect for tech-savvy users who want to manage their own media library.
Prerequisites
Before you begin, ensure you have the following:
- A Debian 12 server.
- A non-root user with sudo privileges.
- A domain name or public IP address for your Emby setup.
Installing Emby Media Server on Debian 12
To kick things off, update your Debian repository and upgrade existing packages using the commands below:
sudo apt update && sudo apt upgrade
sudo reboot
Next, visit the Emby Download Page and copy the link to the latest .deb file for Debian. Use the following wget command to download Emby:
wget https://github.com/MediaBrowser/Emby.Releases/releases/download/4.7.14.0/emby-server-deb_4.7.14.0_amd64.deb
Once downloaded, install Emby using the dpkg command:
sudo dpkg -i emby-server-deb_*.deb
sudo apt install -f
After installation, verify that the Emby service is running with the commands below:
sudo systemctl is-enabled emby-server
sudo systemctl status emby-server
Verifying Emby Server Status
Ensure that the Emby server is active and listening on port 8096:
ss -tulpn
Installing and Configuring Nginx as a Reverse Proxy
Now, let’s set up Nginx as a reverse proxy for your Emby server. First, install Nginx using the following command:
sudo apt install nginx
Verify that Nginx is running:
sudo systemctl is-enabled nginx
sudo systemctl status nginx
Create a new server block for Emby:
sudo nano /etc/nginx/sites-available/emby-server
Add the following configuration to the server block, adjusting your domain name:
server {
listen 80;
server_name emby.howtoforge.local; # Change this to your domainproxy_hide_header X-Powered-By;
add_header X-Xss-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header 'Referrer-Policy' 'no-referrer';location / {
proxy_pass http://localhost:8096;}
Save and exit the editor, then enable the server block:
sudo ln -s /etc/nginx/sites-available/emby-server /etc/nginx/sites-enabled/
sudo nginx -t
Restart the Nginx service to apply the changes:
sudo systemctl restart nginx
Configuring UFW (Uncomplicated Firewall)
Next, we’ll set up UFW to secure your installation. Install UFW with:
sudo apt install ufw
Enable the necessary profiles for OpenSSH and Nginx:
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
Enable UFW:
sudo ufw enable
Securing Emby with SSL/TLS Certificates
To enhance security, it’s vital to use SSL/TLS certificates. For a local instance, a self-signed certificate suffices; for public domains, consider using Let’s Encrypt. Install Certbot:
sudo apt install certbot python3-certbot-nginx
Generate and configure the SSL certificate:
certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [your_email@example.com] -d emby.howtoforge.local
Once complete, you can access your Emby Media Server by visiting http://emby.howtoforge.local/. Follow the setup prompts to create your user account and library.
Conclusion
Congratulations! You have successfully installed and configured the Emby Media Server on Debian 12, integrated Nginx, and set up UFW for a secure streaming experience. Feel free to explore adding various media types and enjoy your newly self-hosted library!
Frequently Asked Questions
1. Can I install Emby on other operating systems?
Yes, Emby supports various operating systems, including Windows, macOS, and FreeBSD, along with Linux distributions.
2. How do I ensure my Emby server is secure?
Implementing SSL/TLS through Certbot and configuring firewalls like UFW are essential for keeping your server secure.
3. Is there a way to access Emby outside my local network?
Yes, by configuring your router and using a public domain with proper SSL/TLS setup, you can access your Emby server from anywhere.