---
title: "Deploy SerpBear"
description: "Self-hosted search engine rank tracker with keyword alerts and an API"
category: "Analytics"
url: https://railway.com/deploy/serpbear-2
---

# Deploy SerpBear

Self-hosted search engine rank tracker with keyword alerts and an API

**[Deploy SerpBear on Railway](https://railway.com/template/serpbear-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/serpbear-2/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Analytics
- **Total deploys:** 1

## Template content

### SerpBear https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/serpbear.png

- **Image:** towfiqi/serpbear:3.1.2@sha256:7a2e29bfe682082642be1e0fe0a0d7b561470427d25a4afd25eca1e7223b993b
- **Start command:** `/bin/sh -c 'export USER_NAME="${USER_NAME:-admin}" HOSTNAME=0.0.0.0; cd /app && npx sequelize-cli db:migrate --env production && exec npx concurrently -k "node server.js" "node cron.js"'`
- **Health check:** /login
- **Public domain:** Yes

## Documentation

# Deploy and Host SerpBear on Railway

SerpBear is an open-source search engine rank tracker. You add your domains and keywords, and it checks where each keyword ranks in Google, keeps a position history with charts, and can send daily or weekly e-mail reports. It also connects to Google Search Console and offers a small REST API.

## About Hosting SerpBear

SerpBear is a single Next.js application with a built-in cron worker, so this template deploys one service from the official `towfiqi/serpbear` image, pinned to v3.1.2 by digest. Its SQLite database and settings are stored on a Railway volume at `/app/data`, so they survive redeploys. The login password, the session and encryption secret, and the API key are generated for you at deploy time. Database migrations run on every start, and Railway health-checks the login page. To fetch rankings you add your own scraper (for example Serper, ScrapingAnt or SearchApi) in Settings. SMTP and Search Console are optional.

## Common Use Cases

* Track the Google positions of your own or your clients' sites for chosen keywords, by country and device
* Get scheduled e-mail reports when keyword positions change
* Pull ranking data into dashboards or scripts through the SerpBear API

## Dependencies for SerpBear Hosting

* A scraping service account (Serper, ScrapingAnt, ScrapingRobot, SearchApi, SerpApi, ValueSerp, Serply, SpaceSerp, HasData, Crazyserp or your own proxy), added in SerpBear's Settings
* Optional: an SMTP account for e-mail notifications, and a Google Search Console service account

### Deployment Dependencies

* SerpBear source and documentation: https://github.com/towfiqi/serpbear and https://docs.serpbear.com/
* Release used by this template: https://github.com/towfiqi/serpbear/releases/tag/v3.1.2
* Official Docker image: https://hub.docker.com/r/towfiqi/serpbear

### Implementation Details

* Sign in at your Railway domain with the username in `USER_NAME` (default `admin`) and the generated `PASSWORD`, both shown in the service's Variables tab.
* `RAILWAY_RUN_UID=0` lets the app write to the Railway volume, which is mounted as root.
* `SECRET` also encrypts the scraper, SMTP and Search Console keys saved in Settings. Don't change it after setup, or you'll have to enter those keys again.
* API calls use the generated `APIKEY` as a bearer token, and only the read, refresh and notify routes accept it:

```bash
curl -H "Authorization: Bearer $APIKEY" https://your-serpbear.up.railway.app/api/domains
curl -H "Authorization: Bearer $APIKEY" "https://your-serpbear.up.railway.app/api/keywords?domain=example.com"
```

## Why Deploy SerpBear on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying SerpBear on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [Plausible WordPress](https://railway.com/deploy/deploy-plausible-for-wordpress-sites) — Cookie-free WordPress stats from your own Plausible
- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Open this page in a browser: https://railway.com/deploy/serpbear-2
