Skip to main content

Running with Docker

Running SerpBear locally using Docker only takes a few seconds. Follow these steps to get SerpBear up and running using Docker.

Using Docker Compose

Step 1:

Create a new folder and create a docker-compose.yaml file with the following content:

services:
app:
image: towfiqi/serpbear:latest
# Build from source instead of pulling the image:
# build: .
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
- USER_NAME=${USER:-admin}
- PASSWORD=${PASSWORD}
- SECRET=${SECRET}
- APIKEY=${APIKEY}
- SESSION_DURATION=${SESSION_DURATION:-24}
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
# Optional: Google Search Console integration
- SEARCH_CONSOLE_CLIENT_EMAIL=${SEARCH_CONSOLE_CLIENT_EMAIL:-}
- SEARCH_CONSOLE_PRIVATE_KEY=${SEARCH_CONSOLE_PRIVATE_KEY:-}
volumes:
- serpbear_appdata:/app/data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s

volumes:
serpbear_appdata:

Change Environment Variables to your needs. The Details of the Environment Variables can be found here.

Step 2:

From the same directory, run the container using the following Command:

docker compose up

Updating Serpbear

Run the following commands to update your Serpbear instance when a new version is available:

docker compose pull
docker compose up