Selfhost
Guide to Self-Deployment with Docker Compose
-
Install Docker and Docker Compose:
Ensure that Docker and Docker Compose are installed on your system. You can follow the official Docker documentation for installation instructions:
-
Create a Docker Compose file:
Create a new file named
docker-compose.ymlin your project directory and paste the following content into it:services:postgres:image: postgresenvironment:POSTGRES_USER: pstream_userPOSTGRES_DB: pstreamPOSTGRES_PASSWORD: YourPasswordHereports:- "5432:5432"networks:- p-stream-networkp-stream:image: ghcr.io/okikio/backend:latestenvironment:DATABASE_URL: postgresql://pstream_user:YourPasswordHere@postgres:5432/pstreamCRYPTO_SECRET: 32CharacterLongStringHereMETA_NAME: unofficial-backendports:- "80:80"depends_on:- postgresnetworks:- p-stream-networkp-stream-frontend:build:context: https://github.com/p-stream/p-stream.gitargs:TMDB_READ_API_KEY: "YourTMDBReadAPIKeyHere"CORS_PROXY_URL: "https://cors.example.tld https://second.cors.example.tld"BACKEND_URL: "https://backend.example.tld"DMCA_EMAIL: "YourEmail"PWA_ENABLED: "true"APP_DOMAIN: "YourDomainHere"OPENSEARCH_ENABLED: "true"GA_ID: "Google ID Here"ports:- "80:80"networks:- p-stream-networkrestart: unless-stoppedp-stream-proxy:image: ghcr.io/p-stream/simple-proxy:latestports:- "3000:3000"networks:- p-stream-networkrestart: unless-stoppednetworks:p-stream-network:driver: bridgeImportant:
- Replace
YourPasswordHerewith your secure database password. - Generate a strong session secret and replace
32CharacterLongStringHere. - Replace
TMDBReadAPIKeywith your api key, learn more here. - Replace
YourDomainHerewith whatever you’ll be using to access your main site, likepstream.mov. - Replace
meta__nameandmeta__description.
- Replace
-
Start the Backend: Open a terminal in the directory containing
docker-compose.ymland execute:Terminal window docker compose up --detach
Accessing Your Backend
Your services should be accessible on (YourPrivateIP):port. To share it outside your local network, you’ll need to configure port forwarding or cloudflared tunnel.
Optional: Implementing a Reverse Proxy
To enhance your SSL and domain configuration, it’s advisable to establish a reverse proxy, such as Nginx. For an optimal choice in this regard, Cloudflare Zero Trust Tunnel is recommended. You can find more information here.