Railway

Deploy Habitica

Deploy and Host Habitica with a persistent MongoDB backend.

Deploy Habitica

Just deployed

/data/db

Deploy and Host Habitica on Railway

Habitica is an open-source habit-building and task-management application that turns daily goals into a role-playing game. This template provides a private Habitica service with a MongoDB replica set, durable database storage, managed HTTPS, and Railway private networking. It is designed for self-hosted productivity data and uses no customer, social, or production data during validation.

What is Habitica?

Habitica helps people build habits and complete tasks through game mechanics such as experience, gold, rewards, quests, parties, and challenges. It supports habits, dailies, to-dos, user accounts, groups, and an API for compatible clients. Review Habitica's upstream terms, API guidance, and license before operating a public instance or integrating third-party services.

About Hosting Habitica

This template runs the pinned Habitica 5.48.8 server image as the only public service. The application listens on port 8080 inside Railway and is reachable through a generated HTTPS domain. A private MongoDB 8.0.11 service runs as a single-node rs replica set because Habitica uses MongoDB transactions; its /data/db path is mounted on one persistent Railway volume. Railway reference variables wire the app to MongoDB and its generated public domain, so clean deployments have no required manual variables. Email, payment, and external integration credentials are not preconfigured.

Back up the MongoDB volume before upgrades. Test major-version changes in a fresh project and preserve the matching image digest and data backup when rolling back.

Common Use Cases

  • Organize personal habits, daily routines, and long-term goals.
  • Run a private task and accountability space for a household or small group.
  • Use Habitica's API and compatible clients against a self-hosted instance.

Dependencies for Habitica Hosting

  • Habitica server 5.48.8, pinned to awinterstein/habitica-server:5.48.8@sha256:1352a3e100b9f6c297086d58d23d5b520198aa186f5293e1d356ea531ec70bfd.
  • MongoDB 8.0.11, pinned to mongo:8.0.11@sha256:5941949d3887e40be5175787aade07dc052f2cddb8ce21b740c3948eba6a3ed0.
  • One Railway volume mounted at /data/db for MongoDB data and replica-set state.

Deployment Dependencies

Implementation Details

The Umbrel package's outer port is 3944, while the pinned server image reports its internal listener on Railway port 8080; only the Habitica service receives a public domain. MongoDB remains private and starts with --replSet rs --bind_ip_all --port 27017. Its startup wrapper initializes the single-node replica set using the Railway private hostname and then keeps mongod in the foreground.

The application uses these Railway references:

  • BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
  • NODE_DB_URI=mongodb://${{Mongo.RAILWAY_PRIVATE_DOMAIN}}:27017/habitica?replicaSet=rs

No application variable lacks a serialized template default. No email provider, payment credential, custom domain, public MongoDB listener, or app_proxy service is included.

Habitica code is GPL v3 licensed. Habitica assets and content may have additional upstream terms, including CC-BY-SA 3.0 and CC-BY-NC-SA 3.0 notices in the upstream license. Operators must host and share only content they are authorized to use. Habitica is a productivity application; this template does not enable cryptocurrency mining, proxies, torrenting, scraping, unauthorized access, or other prohibited activity.

Why Deploy Habitica 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 Habitica 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.


Template Content

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

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

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

Letta
51