Deploy Appwrite | Open Source Firebase Alternative
Railway

Deploy Appwrite | Open Source Firebase Alternative

Self Host Appwrite: auth, DB, storage, realtime, functions & more

Deploy Appwrite | Open Source Firebase Alternative

DB

Just deployed

/var/lib/mysql

Redis-zZ2r

redis:8.2.1

Just deployed

/data

Appwrite

Worker-Deletions

appwrite/appwrite:1.9.0

Just deployed

Appwrite-Console

appwrite/console:7.8.26

Just deployed

Worker-Databases

appwrite/appwrite:1.9.0

Just deployed

Just deployed

/storage

Appwrite-Realtime

appwrite/appwrite:1.9.0

Just deployed

Just deployed

Just deployed

Appwrite logo

Deploy and Host Appwrite on Railway

Deploy on Railway

Self-host Appwrite on Railway for a complete open-source Backend-as-a-Service with authentication, databases, file storage, serverless functions, and real-time WebSocket subscriptions — no vendor lock-in, no per-API-call fees.

This Railway template pre-configures Appwrite 1.9.0 with MariaDB, a Railway-managed Redis, three Swoole workers, the Appwrite Console, and an Nginx reverse proxy that unifies the API, Console, and WebSocket under a single public domain.

Appwrite Railway architecture

Getting Started with Appwrite on Railway

Open the Nginx service domain — the single public URL fronting the whole stack. You'll land on the Appwrite Console sign-in page. Click Sign Up to create the first account (it becomes root admin; further signups are blocked by _APP_CONSOLE_WHITELIST_ROOT=enabled). Create your first Project, copy its Project ID, then integrate your app with the Appwrite SDK.

npm install -g appwrite-cli
appwrite login --endpoint https://${{Nginx.RAILWAY_PUBLIC_DOMAIN}}/v1
appwrite init project

Appwrite Dashboard

About Hosting Appwrite

Appwrite is an open-source BaaS (55,000+ GitHub stars, BSD 3-Clause) that replaces Firebase, Supabase, or custom backend stacks.

  • Auth — email, phone, magic URLs, 30+ OAuth2 providers
  • Databases — document collections with schemas, indexes, queries
  • Storage — uploads with transforms, compression, encryption
  • Functions — serverless execution across 30+ runtimes
  • Messaging — email, SMS, push via provider integrations
  • Realtime — WebSocket subscriptions for live events

The template runs the same appwrite/appwrite:1.9.0 image as API, Realtime, and workers with different start commands — matching Appwrite's docker-compose architecture.

Why Deploy Appwrite on Railway

Deploy Appwrite on Railway in under 10 minutes and keep full data ownership without cloud-provider lock-in.

  • Zero per-API-call or storage fees — pay Railway compute only
  • Railway-managed Redis with auth, backups, and private networking
  • Unified single-domain routing via Nginx reverse proxy
  • Cross-service variable references keep secrets clean and rotatable
  • Automatic TLS termination at Railway's edge — no cert management

Common Use Cases for Self-Hosted Appwrite

  • Mobile app backends — auth, push notifications, and storage for iOS, Android, Flutter, and React Native apps
  • SaaS product backends — multi-tenant projects, team management, webhooks, and role-based access control
  • Real-time collaboration tools — live document editing, chat apps, and dashboards using WebSocket subscriptions
  • Internal tools and admin panels — data management UIs, reporting, and audit-logged workflows

Dependencies for Appwrite

  • Appwrite API (appwrite/appwrite:1.9.0) — PHP/Swoole REST and GraphQL API on port 80
  • Appwrite Console (appwrite/console:7.8.26) — static SvelteKit SPA on port 80
  • Appwrite Realtime (appwrite/appwrite:1.9.0) — Swoole WebSocket server (startCommand: realtime)
  • Worker-Databases / Worker-Deletions / Worker-Mails — background job consumers
  • MariaDB (mariadb:10.11) — relational database for all Appwrite data
  • Redis-zZ2r (Railway-managed Redis) — cache, pub/sub, queues, rate-limiting
  • Nginx (nginx:alpine) — reverse proxy unifying API, Console, and Realtime

Environment Variables Reference for Appwrite on Railway

VariableServiceDescription
_APP_DB_ADAPTERAppwrite + workersMust be mariadb — default is mongodb
_APP_DOMAINAppwrite + workersPublic-facing domain (Nginx URL)
_APP_OPENSSL_KEY_V1Appwrite + workersServer-side encryption key (64 hex chars)
_APP_REDIS_USER / _APP_REDIS_PASSAppwrite + workersAuth for Railway-managed Redis
_APP_OPTIONS_ROUTER_PROTECTIONAppwrite + workersMust be disabled when using a reverse proxy
_APP_CPU_NUM / _APP_WORKER_PER_CORERealtimeCaps Swoole worker count to avoid Railway thread limits
_APP_CONSOLE_WHITELIST_ROOTAppwriteenabled locks signups after the first admin
_APP_STORAGE_LIMITAppwriteMax upload size in bytes (30MB default)

Deployment Dependencies

Hardware Requirements for Self-Hosting Appwrite on Railway

ResourceMinimumRecommended
CPU2 vCPUs4 vCPUs
RAM4 GB8 GB
Storage10 GB50 GB+
RuntimeDocker 20+Docker 24+

Appwrite spreads load across 9 containers. The Realtime service is capped at 4 Swoole workers to stay within Railway's per-container thread limits.

Self-Hosting Appwrite with Docker

Minimal Docker Compose for local development and reference:

services:
  appwrite:
    image: appwrite/appwrite:1.9.0
    environment:
      _APP_DB_ADAPTER: mariadb
      _APP_DB_HOST: mariadb
      _APP_REDIS_HOST: redis
    depends_on: [mariadb, redis]
  mariadb:
    image: mariadb:10.11
    environment:
      MYSQL_DATABASE: appwrite
  redis:
    image: redis:7.4-alpine

On Railway, use cross-service refs like ${{MariaDB.RAILWAY_PRIVATE_DOMAIN}} instead of hostnames:

git clone https://github.com/appwrite/appwrite.git && cd appwrite
docker compose up -d

How Much Does Appwrite Cost to Self-Host on Railway?

Appwrite is 100% free and open-source under BSD 3-Clause — no license fees, no per-API charges, no feature gates. On Railway, you pay compute only ($10–30/month for light traffic). Appwrite Cloud's Pro plan starts at $25/month per organization with caps; self-hosting removes those limits.

FAQ

What is Appwrite and why self-host it on Railway? Appwrite is an open-source BaaS for auth, databases, storage, functions, and real-time. Self-hosting on Railway gives you data ownership, no usage fees, and a private deployment.

What does this Appwrite Railway template deploy? Nine services: Appwrite API, Console, Realtime, three workers (Databases, Deletions, Mails), MariaDB, a Railway-managed Redis, and an Nginx reverse proxy unifying them under one domain.

Why does Appwrite need both MariaDB and Redis? MariaDB stores persistent data (users, projects, collections, file metadata). Redis handles sessions, cache, Realtime pub/sub, rate-limiting, and async job queues.

How do I connect my app to self-hosted Appwrite on Railway? Install the Appwrite SDK, set the endpoint to https:///v1, and paste your Project ID. All SDK methods work identically to Appwrite Cloud.

Why is _APP_DB_ADAPTER=mariadb required in this template? The appwrite/appwrite:1.9.0 image defaults to MongoDB. Without _APP_DB_ADAPTER=mariadb, Appwrite speaks MongoDB wire protocol to MariaDB and crashes.

How do I enable OAuth login in self-hosted Appwrite? In the Console, go to Auth → Settings, enable the provider, paste the OAuth client ID and secret, and add your Nginx callback URL.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser