cobalt/docs/run-an-instance.md
2023-10-28 18:51:20 +06:00

2.4 KiB

how to host a cobalt instance yourself

to run the cobalt docker package, you need to have docker and docker-compose installed and configured.

if you need help with installing docker, follow only the first step of these tutorials by digitalocean:

how to run a cobalt docker package:

  1. create a folder for cobalt config file, something like this:

    mkdir cobalt
    
  2. go to cobalt folder, and create a docker compose config file:

    cd cobalt && nano docker-compose.yml
    

    i'm using nano in this example, it may not be available in your distro. you can use any other text editor.

  3. copy and paste the sample config from here for either web or api instance (or both, if you wish) and edit it to your needs.
    make sure to replace default URLs with yours or cobalt won't work correctly.

if you want your instance to support services that require authentication to view public content, create cookies.json file in the same directory as docker-compose.yml. example file for cookies file can be found here.

cobalt package will automatically update itself thanks to watchtower.

it's highly recommended to use a reverse proxy (such as nginx) if you want your instance to face the public internet. look up tutorials for that online.

using regular node.js (useful for local development)

setup script installs all needed npm dependencies, but you have to install node.js (version 18 or above) and git yourself.

  1. clone the repo: git clone https://github.com/wukko/cobalt.
  2. run setup script and follow instructions: npm run setup. you need to host api and web instances separately, so pick whichever applies.
  3. run cobalt via npm start.
  4. done.

ubuntu 22.04 workaround

nscd needs to be installed and running so that the ffmpeg-static binary can resolve DNS (#101):

sudo apt install nscd
sudo service nscd start