Skip to content

Getting Started ​

This guide walks you through running NukeVideo locally for development with Docker, and then through a production install.

Prerequisites ​

The local stack is defined in compose.yml, Traefik included: it routes every service under *.nukevideo.localhost and needs port 80 free.

Quick Start ​

bash
git clone https://github.com/xdelirio/nukevideo.git
cd nukevideo

cp .env.example .env   # then set AWS_ENDPOINT, see "Local .env" below, before going on

docker compose up -d --build

On every up, the one-shot nukevideo-init service installs the PHP dependencies, generates APP_KEY while .env has none, and runs the migrations; the API, Horizon and the scheduler start once it has finished. Its log is docker compose logs nukevideo-init.

Local .env ​

.env.example already holds working values for the development stack: the panel and the API on http://nukevideo.localhost (Traefik sends /api to Laravel and the rest to Vite, so the session cookie needs nothing else), the db and redis services, and the bundled RustFS with its default credentials. One value is yours to fill in, before the first docker compose up:

  • AWS_ENDPOINT=http://<your machine's LAN IP>:9000. Upload URLs are signed for this address and the browser sends the file straight to it, so it has to work from the browser, from the containers and from any node you deploy: http://rustfs:9000 only resolves inside compose, and localhost inside a container is the container. If port 9000 is taken, set AWS_PORT and use that port here.

Change DB_PASSWORD before the first start if you like: MariaDB is initialised with it, and later changes do not reach an existing database.

docker compose up also runs rustfs-init, a one-shot container that creates the bucket and sets the CORS the browser's uploads need. It runs on every up and leaves a configured bucket as it was. If it exits with an error, the AWS_* keys do not match RustFS's.

Nothing else is configured on the bucket: the API learns that an upload finished when it completes it.

First Login ​

Open the panel (see the URL below). While the instance has no user it shows a setup screen instead of the login, and the account created there is the administrator, with a default project. It is the same screen a production install opens on (see Production).

Nodes in development ​

The stack runs the panel and what it needs. Videos are encoded by worker nodes and played back through proxy nodes, which are deployed over SSH exactly as in production: on this machine, or on any other you can reach. Set them up once, in this order.

  1. The node images. A node never builds: it runs nukevideo:node-dev and nukevideo-proxy:node-dev, which bin/push-node-dev builds from the checkout. Run it on the host:

    • bin/push-node-dev alone is enough for nodes on this machine: they use the images it built.
    • bin/push-node-dev user@host also loads them into another machine over SSH, for nodes there.
    • With DOCKER_REGISTRY set in .env, it pushes them to that registry too, and nodes pull from it (over plain HTTP, every machine involved needs it under insecure-registries in /etc/docker/daemon.json). Optional, and only worth it for nodes on several machines.

    Run it again after every change you want a node to run, and redeploy the node.

  2. SSH access. Under Nodes → Access, generate the panel's key and add its public line to ~/.ssh/authorized_keys of the user each node connects as: any user, as long as it is root or has passwordless sudo (Prerequisites). The panel runs in a container, so it reaches this machine at its LAN IP, never at localhost.

  3. Addresses the nodes can reach. Names like db, redis and nukevideo.localhost only resolve inside the stack. Under Nodes → Environment, set DB_HOST and REDIS_HOST to this machine's LAN IP (compose publishes both ports), and in .env set INTERNAL_API_URL=http://<LAN IP>:8089, where compose publishes the API: the edges ask it for the master manifests. See Database and Redis for the nodes.

  4. A worker. Create one with the LAN IP of the machine it runs on, and deploy it. The first worker also hosts the chunk store, on port 9000 of its address. On this machine that port is the stack's RustFS (AWS_PORT): move one of them, either AWS_PORT=9010 (with AWS_ENDPOINT to match) or the chunk store address <LAN IP>:9009 under Nodes → Environment.

  5. Delivery. Under CDN → Delivery, set the token secret (openssl rand -hex 32). Under CDN → Domains, add cdn.nukevideo.localhost: on plain HTTP it needs no certificate and no Cloudflare, and the browser resolves it to this machine. Add it before the proxy, whose deploy reads the domains.

  6. A proxy. Create it with the LAN IP and deploy it; a development panel ticks none of the host's disks, so the cache goes to a Docker volume. On this machine the stack's Traefik holds port 80: the edge sees it, joins the traefik network and serves behind it, routed by the CDN domains. On another machine, make the domain resolve to that machine instead (DNS, or its hosts file).

Then upload a video from the Videos page: the development stack gives the first project a template, so nothing else is needed.

Local URLs ​

Traefik publishes each service under a *.nukevideo.localhost hostname (these resolve automatically, no /etc/hosts edits needed):

ServiceURL
Admin SPAhttp://nukevideo.localhost
API (Laravel)http://nukevideo.localhost/api (also published directly on http://localhost:8089)
Docshttp://docs.nukevideo.localhost
Adminer (DB UI)http://adminer.nukevideo.localhost
RustFS S3 APIhttp://s3-data.nukevideo.localhost
RustFS consolehttp://s3-ui.nukevideo.localhost
RedisInsighthttp://redis.nukevideo.localhost
Traefik dashboardhttp://localhost:8080

Production ​

Release images are published to Docker Hub on every v* tag (chikenare/nukevideo, chikenare/nukevideo-proxy, for linux/amd64 and linux/arm64). compose.prod.yml runs the core stack from them: the API (which also serves the admin panel), Horizon, the scheduler, MariaDB and Redis. It is not compose.yml, which is the development stack, so name it with -f on every command.

bash
git clone https://github.com/xdelirio/nukevideo.git && cd nukevideo
cp .env.example .env      # then edit it, see the checklist below

echo "base64:$(openssl rand -base64 32)"   # paste into APP_KEY

# Pin a release in .env too: TAG=X.Y.Z (the version, without the `v` of the git tag).
# Unset, every command pulls `latest`, which moves under you.
docker compose -f compose.prod.yml up -d

Compose reads TAG from the .env next to compose.prod.yml, so keeping it there rather than exporting it in one shell makes every later command run the same version.

Then open APP_URL. While the instance has no user, the panel shows a setup screen instead of the login, and the account created there is the administrator. Setup closes for good as soon as that account exists. Until then whoever reaches the panel first becomes the admin, so create it right after the first start. Every other account is created by an admin from the panel's Users page.

The API container runs the migrations itself every time it starts, so there is no separate migrate step. Set APP_KEY before the first start: the migrations store encrypted settings.

compose.prod.yml publishes the API on port 8080 (API_PORT) over plain HTTP. Put a TLS-terminating reverse proxy in front of it; the panel's session cookie is only safe over HTTPS.

.env checklist ​

VariableValue
APP_ENV / APP_DEBUGproduction / false. Debug mode prints stack traces, and with them configuration, to anyone who triggers an error.
APP_KEYThe openssl output above. It encrypts the stored SSH key, the Cloudflare token, the Tailscale key and the CDN certificates' private keys: keep a copy, because a lost key makes them unreadable.
APP_URLThe public HTTPS URL you open the panel at, which is also the API's (https://video.example.com). The panel signs in with a session cookie that is only honoured for this host, so opening it at another address (the server's IP, a second domain) logs you in to nothing; add those to SANCTUM_STATEFUL_DOMAINS.
DB_HOST / REDIS_HOSTdb / redis, the service names in compose.prod.yml. Those names only resolve inside it, and the worker nodes need the database and Redis too: see Database and Redis for the nodes before deploying one.
REDIS_PASSWORDA strong password. compose.prod.yml refuses to start without one: the workers reach Redis over the network, and anyone who reaches it unauthenticated can put jobs on the queues.
DB_PASSWORDA strong password. The MariaDB container is initialised with it, as the root password as well.
INTERNAL_API_SECRETA random value, e.g. openssl rand -hex 32.
AWS_*Your S3 bucket and credentials (see S3 Storage). The bucket also needs a CORS rule for the panel's uploads, described there.
TAGThe release to run (X.Y.Z). Read by Compose, not by the application.
SESSION_SECURE_COOKIEtrue, so the session cookie is never sent over plain HTTP.

The full reference is on the Configuration page.

The admin panel ​

The API image serves the panel at the root of APP_URL, on the same origin as the API, so there is nothing else to deploy: open APP_URL, sign in with the admin you created, and continue with Nodes — workers to encode, proxies to deliver.

Delivery ​

Viewers reach the proxies through CDN domains you own, not through a name per server. Before deploying the first proxy:

  1. Register a domain for the CDN alone (examplecdn.com), in a Cloudflare zone — why its own.
  2. Store a Cloudflare API token with Zone → Zone → Read and Zone → DNS → Edit on that zone, under CDN → Cloudflare. It keeps the domain's records pointing at the proxies and answers the DNS challenge of the certificate the API issues for it.
  3. Add the domain under CDN → Domains, and a second one on another registrar as a fallback if you can.
  4. Put the proxies on one private network and set each one's private address, so they share one cache; open 80 and 443 to everyone and 8090 to the other proxies only.

The rest is automatic: records, certificates and renewals, and every proxy serving every domain. See CDN & Delivery.

Upgrading ​

The panel's sidebar says when a newer release is out (a build from source, whose version is dev, never does). Set TAG in .env to the new version, then:

bash
docker compose -f compose.prod.yml pull
docker compose -f compose.prod.yml up -d

The API runs the new migrations as it starts. Nodes pull the version the panel runs, so they move to it when redeployed, once the API is up: Deploy selected on the nodes page. Read the release notes first: an upgrade that changes how nodes work says what to do and in which order.

Next Steps ​

Released under the MIT License.