---
title: "Deploy Firefly III"
description: "Self-hosted personal finance manager with budgets, rules and Postgres"
category: "Other"
url: https://railway.com/deploy/firefly-iii-2
---

# Deploy Firefly III

Self-hosted personal finance manager with budgets, rules and Postgres

**[Deploy Firefly III on Railway](https://railway.com/template/firefly-iii-2)**

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

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18.6@sha256:4fc833b43d2aaf6ecc9b18615f5533602b723a32d0e2efe2dae8ca0f7217c863

### Firefly III https://docs.firefly-iii.org/_media/76405be5753bbc3343a1.png

- **Image:** fireflyiii/core:version-6.7.9@sha256:d51ab6a3a7b91a5c892441578e0da7f2935f84f36bd1151fc3833acc6e060871
- **Start command:** `/bin/sh -c 'S=/var/www/html/storage; for d in app/public build database debugbar export framework/cache/data framework/sessions framework/testing framework/views logs upload; do mkdir -p "$S/$d"; done; chown -R www-data:www-data "$S"; echo IyEvYmluL3NoCiMgUmFpbHdheSB0ZW1wbGF0ZTogY3JlYXRlIHRoZSBmaXJzdCBGaXJlZmx5IElJSSB1c2VyIChvd25lcikgZnJvbSBBRE1JTl9FTUFJTCAvIEFETUlOX1BBU1NXT1JELAojIG9ubHkgd2hpbGUgdGhlIGRhdGFiYXNlIGhhcyBubyB1c2Vycywgc28gYSBmcmVzaCBwdWJsaWMgZGVwbG95IGNhbid0IGJlIGNsYWltZWQgYnkgYSBzdHJhbmdlci4KY2QgL3Zhci93d3cvaHRtbCB8fCBleGl0IDAKcGhwIDw8J1BIUCcKPD9waHAKcmVxdWlyZSAndmVuZG9yL2F1dG9sb2FkLnBocCc7CiRhcHAgPSByZXF1aXJlICdib290c3RyYXAvYXBwLnBocCc7CiRhcHAtPm1ha2UoSWxsdW1pbmF0ZVxDb250cmFjdHNcQ29uc29sZVxLZXJuZWw6OmNsYXNzKS0+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HN0cmFwL2NhY2hlCmV4aXQgMAo= | base64 -d > /etc/entrypoint.d/12-railway-admin.sh; chmod 755 /etc/entrypoint.d/12-railway-admin.sh; export DB_CONNECTION=pgsql NGINX_HTTP_PORT="${PORT:-8080}" APP_ENV="${APP_ENV:-production}" TRUSTED_PROXIES="${TRUSTED_PROXIES:-**}" TZ="${TZ:-UTC}" DEFAULT_LANGUAGE="${DEFAULT_LANGUAGE:-en_US}" LOG_CHANNEL="${LOG_CHANNEL:-stdout}" APP_LOG_LEVEL="${APP_LOG_LEVEL:-notice}" MAIL_MAILER="${MAIL_MAILER:-log}"; (sleep 300; while :; do curl -fsS -o /dev/null "http://127.0.0.1:${NGINX_HTTP_PORT}/api/v1/cron/${STATIC_CRON_TOKEN}" && echo "Railway cron: Firefly III cron ran" || echo "Railway cron: call failed"; sleep ${CRON_INTERVAL:-3600}; done) & exec docker-php-serversideup-entrypoint /init'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Firefly III on Railway

Firefly III is a free, open-source personal finance manager. It uses double-entry bookkeeping to track your accounts, income and expenses, and adds budgets, categories, bills, piggy banks, recurring transactions, rules and reports. It runs in your browser and has a full REST API, so your financial data stays on a server you control.

## About Hosting Firefly III

Hosting Firefly III means running its PHP web app next to a database, keeping uploaded files and API keys on disk, and running a daily cron job for recurring transactions, auto-budgets and bill reminders. This template runs the official `fireflyiii/core` 6.7.9 image, pinned by digest, with Railway's PostgreSQL. A volume holds Firefly's storage folder. The first user is created from the email you enter and a generated password, and open sign-up closes after that. A loop inside the same service calls Firefly's cron endpoint every hour. A `/health` check, which also queries the database, gates every deploy.

## Common Use Cases

* Track bank accounts, credit cards, cash and savings in one place with double-entry bookkeeping
* Set monthly budgets, schedule recurring bills and income, and watch spending by category
* Import bank exports with the Firefly III Data Importer, or automate bookkeeping through the REST API

## Dependencies for Firefly III Hosting

* PostgreSQL 18 (Railway's `postgres-ssl` image, with a volume)
* A volume for Firefly III's storage folder (uploads, OAuth keys, sessions)

### Deployment Dependencies

* [Firefly III v6.7.9 release notes](https://github.com/firefly-iii/firefly-iii/releases/tag/v6.7.9)
* [Firefly III Docker installation guide](https://docs.firefly-iii.org/how-to/firefly-iii/installation/docker/)
* [Firefly III cron job documentation](https://docs.firefly-iii.org/how-to/firefly-iii/advanced/cron/)
* [`fireflyiii/core` image on Docker Hub](https://hub.docker.com/r/fireflyiii/core)
* [Firefly III configuration reference (`.env.example`)](https://github.com/firefly-iii/firefly-iii/blob/main/.env.example)

### Implementation Details

**First sign-in.** Open your Railway domain and sign in with `ADMIN_EMAIL` and the generated `ADMIN_PASSWORD` (Firefly III service → Variables), then change the password under Options → Profile. The account is created only while the database has no users, so changing `ADMIN_PASSWORD` later has no effect. Registration closes once this user exists (Firefly's single-user mode). To let others sign up, turn it off under Administration → Configuration, or invite people from there.

**Cron.** The start command runs a background loop that calls `/api/v1/cron/STATIC_CRON_TOKEN` on the local web server 5 minutes after start-up and then every hour. Firefly runs each job at most once a day, so recurring transactions are created on their due date. Set `CRON_INTERVAL` (seconds) to change how often it checks.

**Settings.** The start command sets these defaults: PostgreSQL, `TRUSTED_PROXIES=**` (so HTTPS links work behind Railway's proxy), `TZ=UTC`, `DEFAULT_LANGUAGE=en_US`, logs to stdout (`LOG_CHANNEL=stdout`, level `notice`) and `MAIL_MAILER=log`. To change any of them except the database driver, add a service variable with the same name, for example `TZ=Europe/Amsterdam`.

**Email.** No mail server is configured, so password-reset and notification emails are written to the log instead of being sent. To send them, set `MAIL_MAILER=smtp`, `MAIL_HOST`, `MAIL_PORT`, `MAIL_USERNAME`, `MAIL_PASSWORD`, `MAIL_ENCRYPTION` and `MAIL_FROM`.

**API and Data Importer.** Create a personal access token under Options → Profile → OAuth. The OAuth keys are stored on the volume, so tokens keep working after redeploys and upgrades.

**Runs as root.** `RAILWAY_RUN_UID=0` lets the container prepare the Railway volume at start-up. PHP-FPM still serves requests as `www-data`.

## Why Deploy Firefly III 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 Firefly III 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

- [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) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

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