---
title: "Deploy Pretix | (Just Updated) Ticketing Software, Event Ticket Shop With Admin Login And API Token Generated"
description: "Pretix self-hosted ticketing, event ticket shop software, Postgres"
category: "Other"
url: https://railway.com/deploy/pretix-or-just-updated-ticketing-softwar
---

# Deploy Pretix | (Just Updated) Ticketing Software, Event Ticket Shop With Admin Login And API Token Generated

Pretix self-hosted ticketing, event ticket shop software, Postgres

**[Deploy Pretix | (Just Updated) Ticketing Software, Event Ticket Shop With Admin Login And API Token Generated on Railway](https://railway.com/template/pretix-or-just-updated-ticketing-softwar)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/pretix-or-just-updated-ticketing-softwar/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Other

## Template content

### pretix

- **Image:** ghcr.io/bon5co/pretix-railway:2026.9.2@sha256:7e91900e2fd350fe3f5238701bf824e371a811905439f66b051b04f8a8b276ec
- **Public domain:** Yes

### database

- **Image:** postgres:16-alpine@sha256:1d5b02d3a9941fbd52437db4107f8c52d6297dac553ca1e5c299ebb3756b4857

### cache

- **Image:** redis:8.2.1-alpine@sha256:987c376c727652f99625c7d205a1cba3cb2c53b92b0b62aade2bd48ee1593232
- **Start command:** `/bin/sh -c 'chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --maxmemory-policy noeviction --dir /data'`

## Documentation

# Deploy and Host Pretix on Railway

**Built for an LLM agent to deploy and use.** The deploy form has no fields to fill: the administrator login, an organizer API token and the database and Redis passwords are generated, the server cannot start without them, and the upstream default login (`admin@localhost` with password `admin`) is replaced before the web server starts, so nobody can walk into a fresh shop with a published password. Pretix is the open-source ticketing and event shop: ticket sales, seat and quota management, vouchers, check-in, payment plugins and a full REST API.

## About Hosting Pretix

This template runs three services: **pretix**, the official `pretix/standalone` image (2026.9.2) pinned by digest through a thin wrapper, with a volume at `/data` that holds media, the generated secret key and logs; **database**, a PostgreSQL 16 instance with a volume at `/var/lib/postgresql` that holds events, orders and users; and **cache**, a Redis 8 instance with a volume at `/data` that holds sessions, the cache and the background job queue. One public domain serves the shop, the backend and the API. The stock image runs nginx, gunicorn and a celery worker in one container and listens on port 80, which Railway's edge does not dial; the wrapper moves nginx onto the injected `PORT` (8080). Pretix answers 400 to any Host header that is not its configured URL, which includes Railway's healthcheck host, so the template publishes with no HTTP healthcheck; `GET /healthcheck/` answers 200 once the app is up. A cold first boot runs the database migrations, so allow a few minutes before the first request answers.

**What the wrapper fixes.** The official image creates `admin@localhost` with the password `admin` on first migration, and its sign-up page is open to anyone who finds the URL. The wrapper replaces that login with `ADMIN_EMAIL` and `ADMIN_PASSWORD` before the web server starts, creates an organizer (`main`) with an administrators team and an API token from `ADMIN_API_KEY`, and switches public registration off. It hands `/data` to Pretix's service user because Railway mounts volumes owned by root, retries migrations while the database starts, and refuses to start without a login password of at least 12 characters, a 32-character API key and database and Redis credentials. Not reproduced on a Railway control of an incumbent listing.

**Using it.** Open the domain, go to `/control/` and sign in as `ADMIN_EMAIL` with `ADMIN_PASSWORD`. Outgoing email is not configured: add `PRETIX_MAIL_HOST`, `PRETIX_MAIL_PORT`, `PRETIX_MAIL_USER`, `PRETIX_MAIL_PASSWORD` and `PRETIX_MAIL_FROM` variables on the `pretix` service to send order confirmations and tickets. Everything is stored in PostgreSQL, Redis and the `/data` volume, so redeploys keep it.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `pretix` service)
- Private URL: `http://pretix.railway.internal:8080`
- Credentials: the variables `ADMIN_EMAIL`, `ADMIN_PASSWORD` and `ADMIN_API_KEY` on the `pretix` service (plain text; `ADMIN_EMAIL` is `admin@` plus the public domain, the organizer is `main`)
- Auth: send the header `Authorization: Token $ADMIN_API_KEY` on every API call under `/api/v1/`; the backend login at `/control/` uses `ADMIN_EMAIL` and `ADMIN_PASSWORD`
- Health: `GET /healthcheck/` returns 200 without credentials

```bash
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_API_KEY (variables of the pretix service); also curl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; A="Authorization: Token $ADMIN_API_KEY"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/healthcheck/")" = 200 ]; do n=$((n+1)); [ "$n" -le 240 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/healthcheck/"
curl -s -o /dev/null -w "read with key: %{http_code}\n" -H "$A" "$R/api/v1/organizers/"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$R/api/v1/organizers/"
# write-auth: creating an event with the token succeeds, the same call with no credential is refused
B="{\"name\":{\"en\":\"Agent check $$\"},\"slug\":\"agent$$\",\"date_from\":\"2027-01-01T10:00:00Z\",\"currency\":\"EUR\",\"live\":false}"
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$A" -H "Content-Type: application/json" -d "$B" "$R/api/v1/organizers/main/events/"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "Content-Type: application/json" -d "$B" "$R/api/v1/organizers/main/events/"
# signup: registration is switched off, so an anonymous account-creation POST is refused
curl -s -o /dev/null -w "public signup: %{http_code}\n" -d email=stranger@example.org -d "password=$$-Stranger-Login-1" -d "password_repeat=$$-Stranger-Login-1" "$R/control/register"
```

Expected output against a fresh deploy (measured on the Railway demo; the output is recorded in `template.md`):

```text
health: 200
read with key: 200
read without key: 401
write with key: 201
write without key: 401
public signup: 403
```

The refusals are the contract: a read or write without the token answers 401 (`write without key: 401`), and an anonymous account-creation POST answers 403 (`public signup: 403`).

## Why Deploy Pretix 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 Pretix 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.

- **Agent-ready** - no deployer fields, a contract block, and one script that proves the server is healthy, a stranger is refused, and the generated API token can read and write.
- **No published default password** - the `admin@localhost` login is replaced before the first request, and public registration is off.
- **Data survives redeploys** - events and orders in PostgreSQL on a volume, sessions and the job queue in Redis on a volume, media and the secret key on a volume.
- **Migrations run** - the wrapper migrates on boot, so a newer image upgrades the schema on redeploy.
- **Pinned** - the upstream image is pinned by digest and the wrapper by tag and digest.

## Common Use Cases

- **Event ticketing** - sell tickets for conferences, concerts and workshops with quotas, add-ons, vouchers and waiting lists.
- **Check-in and door sales** - scan tickets with the Pretix check-in apps against your own server.
- **Ticketing for an API-driven product** - create events, products and orders from your own backend through the REST API.

## Dependencies for Pretix Hosting

- The pretix service, a PostgreSQL service and a Redis service, each with its volume, created by the template.

### Deployment Dependencies

- [Pretix repository](https://github.com/pretix/pretix)
- [Pretix website](https://pretix.eu)
- [Wrapper image source](https://github.com/bon5co/pretix-railway)


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/pretix-or-just-updated-ticketing-softwar
