Skip to content

Latest commit

 

History

History
81 lines (50 loc) · 2.42 KB

install.md

File metadata and controls

81 lines (50 loc) · 2.42 KB

Self-hosting Slash with Docker

Slash is designed for self-hosting through Docker. No Docker expertise is required to launch your own instance. Just basic understanding of command line and networking.

Requirements

The only requirement is a server with Docker installed.

Docker Run

To deploy Slash using docker run, just one command is needed:

docker run -d --name slash --publish 5231:5231 --volume ~/.slash/:/var/opt/slash yourselfhosted/slash:latest

This will start Slash in the background and expose it on port 5231. Data is stored in ~/.slash/. You can customize the port and data directory.

Upgrade

To upgrade Slash to latest version, stop and remove the old container first:

docker stop slash && docker rm slash

It's recommended but optional to backup database:

cp -r ~/.slash/slash_prod.db ~/.slash/slash_prod.db.bak

Then pull the latest image:

docker pull yourselfhosted/slash:latest

Finally, restart Slash by following the steps in Docker Run.

Docker Compose Run

Assume that docker compose is deployed in the /opt/slash directory.

mkdir -p /opt/slash && cd /opt/slash
curl -#LO https://github.com/yourselfhosted/slash/raw/main/docker-compose.yml
docker compose up -d

This will start Slash in the background and expose it on port 5231. Data is stored in Docker Volume slash_slash. You can customize the port and backup your volume.

Use PostgreSQL as Database

Slash supports the following database types:

  • SQLite (default)
  • PostgreSQL

Using PostgreSQL

To switch to PostgreSQL, you can use the following steps:

  • --driver postgres : This argument specifies that Slash should use the postgres driver instead of the default sqlite.

  • --dsn postgresql://postgres:PASSWORD@localhost:5432/slash : Provides the connection details for your PostgreSQL server.

You can start Slash with Docker using the following command:

docker run -d --name slash --publish 5231:5231 --volume ~/.slash/:/var/opt/slash yourselfhosted/slash:latest --driver postgres --dsn 'postgresql://postgres:PASSWORD@localhost:5432/slash'

Additionally, you can set these configurations via environment variables:

SLASH_DRIVER=postgres
SLASH_DSN=postgresql://root:password@localhost:5432/slash

Note that if the PostgreSQL server is not configured to support SSL connections you will need to add ?sslmode=disable to the DSN.