Skip to the page
Social CrawlDocs

Install the server

Updated
View as Markdown

Set up the Social Crawl server with Dokploy, step by step, with every command and what you should see after each step.

On this page

This page puts the server on a machine of your own, using Dokploy (opens in a new tab). Dokploy builds Social Crawl from its code, runs it, gives it a web address with HTTPS, and updates it when the code changes.

What you need before you start#

  • A server with Docker, where you can run Dokploy. Install Dokploy first by following its own instructions at docs.dokploy.com (opens in a new tab).
  • Two web addresses that point at that server, for example app.example.com (the web app) and api.example.com (the extension talks to this one directly).
  • The Social Crawl code in a Git repository that Dokploy can reach (your copy of the repository).
  • A computer with a terminal and Node.js (opens in a new tab) 20 or newer, to make your password's hash in step 2. Any recent Mac, Linux or Windows (with WSL or Git Bash) will do.

Step 1: Choose your secrets#

You need three values. Make them now and keep them in a password manager.

The database password. Letters and numbers only, because it is placed inside an address.

Terminal
openssl rand -hex 24

You should see one line of 48 letters and digits, for example 9f2c…. This is POSTGRES_PASSWORD.

The signing secret. It signs your login and also encrypts the WebDAV password you may save later.

Terminal
openssl rand -base64 48

You should see one line of 64 characters. This is JWT_SECRET. It must be at least 32 characters.

Step 2: Make your password's hash#

The server never stores your password. It stores a hash of it. This command makes the hash from a password you choose (at least 12 characters) without writing the password to a file:

Terminal
printf '%s' 'your password here' | node -e "let s='';process.stdin.on('data',d=>s+=d).on('end',()=>{const c=require('crypto'),salt=c.randomBytes(16);c.scrypt(s.replace(/\r?\n\$/,''),salt,64,{N:32768,r:8,p:1,maxmem:67108864},(e,k)=>{if(e)throw e;console.log('scrypt:'+salt.toString('base64')+':'+k.toString('base64'))})})"

You should see one line that starts with scrypt: and is exactly 120 characters long. This is ADMIN_PASSWORD_HASH. Copy the whole line.

Step 3: Create the Compose service in Dokploy#

  1. In Dokploy, create a project, then add a Compose service.
  2. Set the provider to GitHub (or the Git provider you use), pick your Social Crawl repository and the main branch.
  3. Set the compose path to ./docker-compose.yml.

Step 4: Set the environment#

Open the service's Environment tab and paste these three lines, with your own values:

Text
POSTGRES_PASSWORD=the-48-letter-value-from-step-1
JWT_SECRET=the-64-character-value-from-step-1
ADMIN_PASSWORD_HASH=scrypt:...the whole 120-character line from step 2

The stack refuses to start without JWT_SECRET and ADMIN_PASSWORD_HASH. Every other setting has a default, and Environment variables lists them all.

Step 5: Add the two domains#

On the Domains tab add:

ServicePortExample address
web3000app.example.com
api4000api.example.com

Turn on HTTPS for both. Turn on Auto Deploy, so every change to the branch is built and started by itself.

Step 6: Deploy#

Press Deploy. Dokploy builds two images (the first build takes several minutes) and starts three containers: db (the database), api and web.

What you should see: the service's status turns to running, and the three containers are listed as healthy or running.

Step 7: Check that it works#

Open https://api.example.com/health in a browser. You should see:

JSON
{"status":"ok"}

Then open https://app.example.com. You should see the sign-in page: the name Social Crawl, the line "Your saved posts, offline and in one place.", and a single Password box.

Go on to Sign in for the first time.

Using plain Docker without Dokploy#

The compose file was written for Dokploy. It joins an external network named dokploy-network and publishes no ports, because Dokploy's proxy reaches the containers by name. To run it without Dokploy you would:

  1. Create the network once: docker network create dokploy-network.
  2. Put the three values in a .env file next to docker-compose.yml.
  3. Run docker compose up -d --build.
  4. Put a reverse proxy of your own in front, sending your web address to the web container (port 3000) and your API address to the api container (port 4000), with HTTPS.

Optional next steps#