# Install a self-hosted server

> Install the pushq server from a GitHub release binary, the Docker image, go install or source, then create the first admin account.

Source: https://pushqueue.dev/docs/self-hosting/install/

pushq is a single static binary that contains the API, the dispatcher and the dashboard. Install it one of four ways, then run `pushq serve` (production) or `pushq dev` (local development).

Use this page when you want to run pushq on your own machine or servers. If you'd rather not run anything, use the hosted API at `https://api.pushqueue.dev` and sign up in the [console](https://console.pushqueue.dev/).

## Install options at a glance


**Binary**

```bash
VERSION=1.0.0   # or any release from GitHub Releases
curl -fsSLO https://github.com/blissfulrays/pushq/releases/download/v${VERSION}/pushq_${VERSION}_linux_amd64.tar.gz
tar -xzf pushq_${VERSION}_linux_amd64.tar.gz
sudo install pushq /usr/local/bin/pushq
```

**Docker**

```bash
docker run -p 8080:8080 -v pushq-data:/data ghcr.io/blissfulrays/pushq:latest
```

**go install**

```bash
# API and dispatcher only; no dashboard
go install github.com/blissfulrays/pushq/cmd/pushq@latest
```

**Source**

```bash
git clone https://github.com/blissfulrays/pushq.git
cd pushq
make build   # needs Go and Node.js 20+; embeds the dashboard
```

The sections below explain each option.

## Download a release binary

Every release on [GitHub Releases](https://github.com/blissfulrays/pushq/releases) ships prebuilt binaries with the dashboard embedded:

| OS | Architectures | Archive |
|---|---|---|
| Linux | `amd64`, `arm64` | `.tar.gz` |
| macOS | `amd64`, `arm64` | `.tar.gz` |
| Windows | `amd64` | `.zip` |

Archives are named `pushq_<version>_<os>_<arch>`, for example `pushq_1.0.0_linux_amd64.tar.gz`, and contain the `pushq` binary, `LICENSE` and `README.md`. Each release also has a `checksums.txt`.

```bash
VERSION=1.0.0   # pick the release you want
curl -fsSLO https://github.com/blissfulrays/pushq/releases/download/v${VERSION}/pushq_${VERSION}_linux_amd64.tar.gz
curl -fsSLO https://github.com/blissfulrays/pushq/releases/download/v${VERSION}/checksums.txt
sha256sum --check --ignore-missing checksums.txt
tar -xzf pushq_${VERSION}_linux_amd64.tar.gz
sudo install pushq /usr/local/bin/pushq
pushq version
```

:::tip
`https://github.com/blissfulrays/pushq/releases/latest` always points at the newest stable release.
:::

## Run the Docker image

The image is `ghcr.io/blissfulrays/pushq`, built for `linux/amd64` and `linux/arm64` with the dashboard included.

| Tag | Points at |
|---|---|
| `:<version>` (e.g. `:1.0.0`) | That exact release. Use this in production. |
| `:latest` | The newest stable release. |
| `:edge` | The newest release of any kind, prereleases included. Moves on every release. |

The image runs `pushq serve` by default, as a non-root user, listens on port `8080`, declares a volume at `/data`, and sets `PUSHQ_DB=sqlite:/data/pushq.db`. Configure it with `PUSHQ_*` environment variables (see the [server configuration reference](https://pushqueue.dev/docs/self-hosting/configuration/)):


**SQLite**

```bash
docker run -p 8080:8080 -v pushq-data:/data ghcr.io/blissfulrays/pushq:latest
```

**Postgres**

```bash
docker run -p 8080:8080 \
  -e PUSHQ_DB='postgres://pushq:secret@db.internal/pushq?sslmode=disable' \
  ghcr.io/blissfulrays/pushq:1.0.0
```

The image is distroless: it has no shell, `curl` or `wget`. Health checks that run a command inside the container won't work; probe `GET /healthz` or `GET /readyz` from outside instead (see [health and readiness checks](https://pushqueue.dev/docs/self-hosting/operations/#health-and-readiness-checks)).

## Install with go install

```bash
go install github.com/blissfulrays/pushq/cmd/pushq@latest
```

This needs the Go version in the module's `go.mod` (currently Go 1.26). The result is a fully working server, but **without the dashboard**: the compiled dashboard is a build artifact, not a committed file, and the Go module proxy never runs npm. A binary built this way serves a short placeholder page at `/`; the API, dispatcher and metrics are unaffected.

Use this when you only need the API, for example in CI or for SDK tests.

## Build from source with the dashboard

To build the binary with the dashboard embedded you need Go and Node.js 20 or newer:

```bash
git clone https://github.com/blissfulrays/pushq.git
cd pushq
make build      # builds the dashboard (web/) first, then ./pushq
./pushq version
```

`make build-go` skips the dashboard build, like `go install`.

## Run the server for the first time

Start the server with SQLite (the default database is `sqlite:pushq.db` in the working directory) or with Postgres, which lets you run several replicas:


**SQLite**

```bash
pushq serve --db sqlite:/var/lib/pushq/pushq.db --listen :8080
```

**Postgres**

```bash
pushq serve --db postgres://user:pass@host/pushq --listen :8080
```

Database migrations run automatically on startup. You can also run them on their own with `pushq migrate`.

### Create the first admin account

A new server with no `api_keys` in its config and no dashboard accounts is **unauthenticated**: anyone who can reach it can use the API. The server logs a warning saying so until you close it.

1. Open the dashboard at `http://<host>:8080/`.
2. It asks you to create the admin account (email, name, password).
3. From then on every API request needs a login session or an API key.

Do this before you expose the server publicly. If the config already has `api_keys`, setup also asks for one of its **admin** keys, so a protected server can't be claimed by whoever reaches the dashboard first.

Then create API keys for your apps under **Settings → API keys** (see [API keys](https://pushqueue.dev/docs/guides/api-keys/)), or define them in the config file.

:::caution
Serve the dashboard over HTTPS. Behind a TLS-terminating proxy, forward `X-Forwarded-Proto: https` so pushq marks the session cookie `Secure`. See [reverse proxy setup](https://pushqueue.dev/docs/self-hosting/deploy/#put-pushq-behind-a-reverse-proxy).
:::

### Recover a locked-out admin account

`pushq users` works directly on the database, so it works even when nobody can sign in:

```bash
pushq users list -c /etc/pushq/pushq.yaml
pushq users reset-password you@example.com -c /etc/pushq/pushq.yaml --url https://pushq.example.com
```

`reset-password` prints a one-time link. Opening it lets the person choose a new password and signs them out everywhere.

## Run a local dev server with pushq dev

```bash
pushq dev
```

`pushq dev` runs a full server with authentication disabled, SQLite in a temp file (`pushq-dev.db` in your OS temp directory), debug logs and faster internal timers. Add `--memory` for an in-memory database that is discarded on exit, and `--listen :9090` to change the port.

Never expose a `pushq dev` server: it accepts every request. See [local development](https://pushqueue.dev/docs/getting-started/local-development/) for a walkthrough.

## Read more

- [Server configuration reference](https://pushqueue.dev/docs/self-hosting/configuration/): every config key, environment variable and CLI flag.
- [Deploy to production](https://pushqueue.dev/docs/self-hosting/deploy/): systemd, docker-compose with Postgres, reverse proxies.
- [Monitoring, backups and upgrades](https://pushqueue.dev/docs/self-hosting/operations/): health checks, metrics and day-2 operations.
- [SaaS mode with WorkOS](https://pushqueue.dev/docs/self-hosting/saas-mode/): multi-team sign-in.
- [Install & configure an SDK](https://pushqueue.dev/docs/getting-started/sdks/): point a client at your server.
