Comprehensive Guide to Installing Stremio Web and Service on Ubuntu

This guide will walk you through the process of installing both the Stremio Web client and the Stremio Service on an Ubuntu server. This setup will allow you to run your own Stremio instance for streaming media content.

Prerequisites

Before we begin, ensure you have:

  1. An Ubuntu server (20.04 LTS or newer recommended)
  2. Root or sudo access to your server
  3. Basic knowledge of command-line operations

Need a reliable server to host your Stremio instance? Check out Servers Guru for high-performance servers optimized for media streaming applications.

Part 1: Installing Stremio Service

First, we’ll install the Stremio Service, which is the backend component.

Step 1: Update Your System

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Dependencies

sudo apt install -y git curl build-essential

Step 3: Install Node.js and npm

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install -y nodejs

Step 4: Clone the Stremio Service Repository

git clone https://github.com/Stremio/stremio-service.git
cd stremio-service

Step 5: Install Service Dependencies

npm install

Step 6: Build the Service

npm run build

Step 7: Create a Systemd Service File

Create a new file:

sudo nano /etc/systemd/system/stremio-service.service

Add the following content:

[Unit]
Description=Stremio Service
After=network.target

[Service]
ExecStart=/usr/bin/node /path/to/stremio-service/build/index.js
Restart=always
User=nobody
Group=nogroup
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/path/to/stremio-service

[Install]
WantedBy=multi-user.target

Replace /path/to/stremio-service with the actual path where you cloned the repository.

Step 8: Start and Enable the Service

sudo systemctl start stremio-service
sudo systemctl enable stremio-service

Part 2: Installing Stremio Web

Now, let’s install the Stremio Web client.

Step 1: Install Nginx

sudo apt install -y nginx

Step 2: Clone the Stremio Web Repository

cd ~
git clone https://github.com/Stremio/stremio-web.git
cd stremio-web

Step 3: Install Web Client Dependencies

npm install

Step 4: Build the Web Client

npm run build

Step 5: Configure Nginx

Create a new Nginx configuration file:

sudo nano /etc/nginx/sites-available/stremio

Add the following content:

server {
    listen 80;
    server_name your_domain.com;

    root /path/to/stremio-web/build;
    index index.html;

    location / {
        try_files $uri $uri/ /index.html;
    }

    location /api {
        proxy_pass http://localhost:11470;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Replace your_domain.com with your actual domain or server IP, and /path/to/stremio-web with the actual path where you cloned the repository.

Step 6: Enable the Nginx Configuration

sudo ln -s /etc/nginx/sites-available/stremio /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Step 7: Secure with Let’s Encrypt (Optional)

If you’re using a domain, secure your Stremio instance with SSL:

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your_domain.com

Follow the prompts to complete the SSL setup.

Finalizing the Setup

  1. Ensure both the Stremio Service and Nginx are running:
sudo systemctl status stremio-service
sudo systemctl status nginx
  1. Access your Stremio Web client by navigating to http://your_domain.com (or https:// if you set up SSL) in your web browser.

Optimizing Your Stremio Instance

For the best streaming experience:

  1. Allocate Sufficient Resources: Ensure your server has enough CPU and RAM. Servers Guru offers high-performance options suitable for media streaming applications like Stremio.

  2. Network Optimization: Ensure your server has good network throughput for smooth streaming.

  3. Regular Updates: Keep both Stremio components and your system updated for the latest features and security improvements.

  4. Monitoring: Set up monitoring for your server to ensure optimal performance and quick problem resolution.

By following this guide, you now have your own Stremio instance running on Ubuntu, complete with both the service backend and web frontend. This setup allows you to stream content through your own server, giving you more control over your media consumption.

Enjoy your personal Stremio streaming service!