& also move "api key file format" section to the actually relevant doc, aka `protect-an-instance`
2.6 KiB
how to run a cobalt instance
using docker compose and package from github (recommended)
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:
-
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.ymli'm using
nanoin 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.
run cobalt api outside of docker (useful for local development)
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
.envfile in the same directory. - add needed environment variables to
.envfile. onlyAPI_URLis 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.
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
list of environment variables
this section has moved to a dedicated document that is way easier to understand and maintain. go check it out!