this tutorial will help you run your own cobalt processing instance. if your instance is public-facing, we highly recommend that you also protect it from abuse using turnstile or api keys or both.
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:
-
create a folder for cobalt config file, something like this:
mkdir cobalt
-
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. -
copy and paste the sample config from here and edit it to your needs. make sure to replace default URLs with your own or cobalt won't work correctly.
-
finally, start the cobalt container (from cobalt directory):
docker compose up -d
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 cookies file can be found here.
cobalt package will update automatically 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 online.
requirements:
- node.js >= 18
- git
- pnpm
- clone the repo:
git clone https://github.com/imputnet/cobalt
. - go to api/src directory:
cd cobalt/api/src
. - install dependencies:
pnpm install
. - create
.env
file in the same directory. - add needed environment variables to
.env
file. onlyAPI_URL
is required to run cobalt.- if you don't know what api url to use for local development, use
http://localhost:9000/
.
- if you don't know what api url to use for local development, use
- run cobalt:
pnpm start
.
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
this section has moved to a dedicated document that is way easier to understand and maintain. go check it out!