---
title: "Deploy AiToEarn"
description: "AI content creation and multi-platform social publishing for creators"
category: "AI/ML"
url: https://railway.com/deploy/aitoearn
---

# Deploy AiToEarn

AI content creation and multi-platform social publishing for creators

**[Deploy AiToEarn on Railway](https://railway.com/template/aitoearn)**

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

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/redis.png

- **Image:** redis:8.2.3-alpine@sha256:08ad0b1d280850169a790dba1393ff7a90aef951fc19632cf4d3ce4f78e679ba
- **Start command:** `/bin/sh -c "rmdir /data/lost+found 2>/dev/null; exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --appendonly yes --save 60 1 --dir /data"`

### AiToEarn Server https://raw.githubusercontent.com/yikart/AiToEarn/v2.5.0/project/aitoearn-web/public/logo.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template
- **Health check:** /health

### MongoDB https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/mongodb.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template

### AiToEarn AI https://raw.githubusercontent.com/yikart/AiToEarn/v2.5.0/project/aitoearn-web/public/logo.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template
- **Health check:** /health

### RustFS https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rustfs.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template
- **Health check:** /health

### AiToEarn https://raw.githubusercontent.com/yikart/AiToEarn/v2.5.0/project/aitoearn-web/public/logo.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template
- **Health check:** /_nhealth
- **Public domain:** Yes

### AiToEarn Web https://raw.githubusercontent.com/yikart/AiToEarn/v2.5.0/project/aitoearn-web/public/logo.png

- **Source:** https://github.com/aalfath/aitoearn-railway-template
- **Health check:** /healthz

## Documentation

# Deploy and Host AiToEarn on Railway

AiToEarn is an open-source (MIT) AI content platform for creators. It drafts posts, images and videos with AI models, keeps a media library, and publishes or schedules content to many social platforms (TikTok, YouTube, Instagram, X, LinkedIn, Xiaohongshu, Douyin and more) from one dashboard.

## About Hosting AiToEarn

AiToEarn runs as several services: a Next.js web app, a NestJS backend API, a NestJS AI service, MongoDB as a replica set (the backend uses transactions), Redis for queues and cache, and S3-compatible storage for uploads and generated media. This template deploys all of them on Railway's private network, generates every password and secret, and puts an nginx gateway on the public domain. The gateway routes the web app, the API and public media, and asks for a login before the web app, because upstream's web app signs every visitor in as the admin. Configuration is saved on volumes and survives redeploys and updates.

## Common Use Cases

* Write and schedule posts for several social accounts from one place
* Generate drafts, images and videos with your own AI provider keys
* Keep a shared media library for a creator or small marketing team

## Dependencies for AiToEarn Hosting

* MongoDB 7.0 (single-member replica set, included)
* Redis 8.2 and RustFS S3 storage (included)

### Deployment Dependencies

* [AiToEarn on GitHub](https://github.com/yikart/AiToEarn)
* [Template source and changelog](https://github.com/aalfath/aitoearn-railway-template)
* Optional: a Relay API key from [aitoearn.ai](https://aitoearn.ai) for social-platform sign-in, and API keys for the AI providers you use

### Implementation Details

Services:

* **AiToEarn**: public nginx gateway. Login in front of the web app, `/api/` to the backend and AI service, `/oss/` for public media. Blocks the unauthenticated `/api/_shutdown` and `/api/metrics` routes.
* **AiToEarn Web**: the Next.js dashboard.
* **AiToEarn Server**: backend API (v2.5.0 plus upstream fixes to 2026-11-06). Creates the admin user and the storage bucket on first start.
* **AiToEarn AI**: AI models, agent and draft generation.
* **MongoDB**, **Redis**, **RustFS**: database, queue/cache and object storage, each on its own volume.

After deploy:

1. Open the AiToEarn service's domain and sign in as `admin` with the `AUTH_PASSWORD` from that service's Variables tab.
2. In the app, open Configuration Management and add a Relay API key and your AI provider keys.
3. For a custom domain, set `PUBLIC_URL` on AiToEarn Server and AiToEarn AI to `https://YOUR-DOMAIN` and redeploy both.

Updates: every service except Redis builds from the template's GitHub repo with pinned image versions. When we pin a new AiToEarn release, Railway shows an update notice on your project; read the changelog, then apply it.

## Why Deploy AiToEarn 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 AiToEarn 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

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/aitoearn
