Install script
Install or upgrade Sniptide on a server with one command that writes the settings, starts Docker Compose and serves your domain over HTTPS.
The install script sets up the Docker Compose install on one
server. It downloads the Compose files, writes .env with a generated auth secret and database
password, and starts Sniptide and Postgres. With a domain, the bundled Caddy proxy serves it over
HTTPS.
Before you begin
- A Linux server with Docker and the Docker Compose plugin. To install both, run
curl -fsSL https://get.docker.com | sh. - About 1 GB of memory. See Memory and resources.
- For HTTPS, a domain whose DNS points at the server, with ports 80 and 443 open.
Run the script
Run this on the server:
curl -fsSL https://sniptide.com/install.sh | shThe script asks for your domain. Enter it, such as paste.example.com, or leave it empty to try
Sniptide on plain HTTP at the server's address first. When it finishes, it prints the address to
open. Open it and create your account.
The script is scripts/install.sh in the repository, and
https://raw.githubusercontent.com/Dino-Kupinic/sniptide/main/scripts/install.sh serves the same
file. Download it and read it first if you prefer:
curl -fsSL https://sniptide.com/install.sh -o install.sh
sh install.shWhat the script does
- Checks that Docker, the Compose plugin and the Docker daemon are available.
- Downloads
docker-compose.ymland.env.examplefrom the latest release into./sniptide. - Writes
.env, readable only by you, with:- a random
BETTER_AUTH_SECRETandPOSTGRES_PASSWORD; ALLOW_SIGN_UP=first, so sign-up closes once your account exists;- with a domain,
SNIPTIDE_DOMAIN,COMPOSE_PROFILES=proxyto start Caddy,SNIPTIDE_BIND=127.0.0.1so port 3000 isn't public,BETTER_AUTH_URL=https://<domain>,CLIENT_IP_SOURCE=x-forwarded-forandTRUSTED_PROXIES=private; - without a domain,
BETTER_AUTH_URL=http://<server-ip>:3000.
- a random
- Pulls the images and runs
docker compose up -d, then waits until every service is healthy.
The install folder then holds three files. Postgres keeps its data in a Docker volume, not in the folder.
- sniptide
- docker-compose.ymlThe services: Sniptide, Postgres and, with a domain, Caddy.
- .env.exampleEvery setting with its default, for reference.
- .envYour settings, readable only by you.
Back up .env with your database. Changing or losing BETTER_AUTH_SECRET signs everyone out and
makes stored env values unreadable. See Backups and restore.
Options
Pass options after sh -s --, or set the matching environment variable:
curl -fsSL https://sniptide.com/install.sh | sh -s -- --domain paste.example.com --yes| Option | Variable | Default | What it does |
|---|---|---|---|
--domain NAME | SNIPTIDE_DOMAIN | asked | The public domain for HTTPS. |
--dir PATH | SNIPTIDE_DIR | ./sniptide | The folder for the Compose files and .env. |
--ref REF | SNIPTIDE_REF | the latest release | The Git tag or branch to download the Compose files from. |
--yes | SNIPTIDE_YES=1 | off | Asks nothing, for automation. Without a domain, the instance runs on plain HTTP. |
Upgrade
Run the script again in the same folder. It keeps .env, downloads the Compose files of the
latest release and pulls the newer image. Take a backup first, and read
Upgrading for releases that need a manual step.
Add a domain later
If you started without a domain, edit .env in the install folder. Remove the BETTER_AUTH_URL
line and add the lines below, then run docker compose up -d there:
SNIPTIDE_DOMAIN=paste.example.com
COMPOSE_PROFILES=proxy
SNIPTIDE_BIND=127.0.0.1If something fails
- "can't reach the Docker daemon": start Docker with
sudo systemctl start docker, or run the script withsudo sh. - The certificate isn't issued: check that the domain's DNS points at the server and that
ports 80 and 443 are open, then run
docker compose logs proxyin the install folder. Caddy keeps retrying. - "Invalid origin" on sign-in: open the exact address the script printed. See Configuration.
To start over, run docker compose down -v in the install folder, which deletes every account and
paste, then delete .env and run the script again.