---
title: "Deploy OpenProfit"
description: "See what each app earns after its OpenAI, Vercel and Railway bills."
category: "Analytics"
url: https://railway.com/deploy/openprofit
---

# Deploy OpenProfit

See what each app earns after its OpenAI, Vercel and Railway bills.

**[Deploy OpenProfit on Railway](https://railway.com/template/openprofit)**

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

- **Creator:** morencyr's Projects
- **Category:** Analytics

## Template content

### OpenProfit

- **Image:** ghcr.io/morencyr/openprofit:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenProfit on Railway

OpenProfit shows what each of your apps earns after costs. It pulls revenue from Stripe, Polar, Paddle, Lemon Squeezy and RevenueCat, and costs from OpenAI, Anthropic, Vercel, Cloudflare, Railway and more. You assign each OpenAI project, Vercel project or Railway project to a product and see profit per product. From the same data, you download a monthly journal for QuickBooks or Xero and the lines for your tax return.

## About Hosting OpenProfit

The template deploys one service from the `ghcr.io/morencyr/openprofit` image, on a public domain. OpenProfit keeps its data in an embedded Postgres database on a volume at `/app/data`, so you have no database service to run. Railway generates `SECRET_KEY`, which OpenProfit uses to encrypt the provider keys you paste in, and sets `APP_URL` to the domain.

When the deploy finishes, open `/login` on your domain and enter your email. Without an email provider, OpenProfit writes the sign-in link to the service's deploy logs. Add `RESEND_API_KEY` and `EMAIL_FROM` to send it by mail.

## Common Use Cases

- Track profit per app when you run several products on the same providers
- Get an alert when an AI or hosting bill jumps, before the invoice arrives
- Export each month's revenue and costs to QuickBooks or Xero, and get the lines for T2125 or Schedule C

## Dependencies for OpenProfit Hosting

- API keys for the revenue and cost providers you connect
- A Resend API key, if you want sign-in links and the weekly email sent by mail

### Deployment Dependencies

- Source code: https://github.com/morencyr/openprofit
- Self-hosting guide: https://openprofit.dev/docs/self-host
- Environment variables: https://openprofit.dev/docs/environment

### Implementation Details

Keep `SECRET_KEY` as Railway generated it. If you change it, OpenProfit can't read the stored provider keys and you have to reconnect every provider. To use your own Postgres server instead of the volume, set `DATABASE_URL` to a `postgres://` connection string.

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

- [Typesense Multilingual](https://railway.com/deploy/deploy-typesense-multilingual-search) — Locale-aware multilingual search with Typesense
- [Formbricks | Open-Source Typeform & Qualtrics Alternative](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube
- [Typesense PHP](https://railway.com/deploy/typesense-php) — official PHP client against Railway

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