---
title: "Deploy Ghostfolio (Self-Hosted Portfolio and Wealth Tracker)"
description: "Self-hosted Ghostfolio: track stocks, ETFs and crypto in one private app."
category: "Analytics"
url: https://railway.com/deploy/ghostfolio-portfolio-tracker
---

# Deploy Ghostfolio (Self-Hosted Portfolio and Wealth Tracker)

Self-hosted Ghostfolio: track stocks, ETFs and crypto in one private app.

**[Deploy Ghostfolio (Self-Hosted Portfolio and Wealth Tracker) on Railway](https://railway.com/template/ghostfolio-portfolio-tracker)**

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

- **Creator:** blueorange
- **Category:** Analytics

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

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

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Ghostfolio https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/ghostfolio.svg

- **Image:** ghostfolio/ghostfolio:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Ghostfolio on Railway

![Ghostfolio on a phone, showing portfolio performance](https://raw.githubusercontent.com/ghostfolio/ghostfolio/main/apps/client/src/assets/images/screenshot.png)

Ghostfolio is the open-source wealth management app with **9,500+ GitHub stars** for tracking stocks, ETFs, crypto and cash across all your brokers in one dashboard. It shows performance with dividends, allocation, risk checks and net worth, without handing your holdings to a finance company. This template self-hosts Ghostfolio on Railway with Postgres and Redis, generated secrets and HTTPS. Sharesight charges $18/month for unlimited holdings, and its free plan stops at 10. Self-hosted Ghostfolio tracks unlimited holdings and accounts for about $5–10/month, and your financial data stays in your own database.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **Ghostfolio** | The Ghostfolio web app and API (NestJS and Angular) on port `3333`, served over HTTPS. It works as a mobile-friendly app you can install (PWA). |
| **Postgres** | Postgres 18 storing your accounts, transactions, holdings, users and settings, on a persistent volume. |
| **Redis** | Cache for market data and background jobs, password-protected and persisted to a volume. |

All three services connect through Railway reference variables on the private network. The JWT secret and access-token salt are generated for you, and the public URL is set from your Railway domain.

---

## About Hosting Ghostfolio

Most portfolio trackers want your brokerage logins, sell your data, or charge more as your number of holdings grows. Ghostfolio takes a different approach: you add transactions yourself (or import them from CSV or JSON), and it pulls prices from public market data sources such as Yahoo Finance and CoinGecko. You get a clear, private view of your whole portfolio across brokers, currencies and asset classes.

Running it yourself means a Node.js app, Postgres with Prisma migrations, Redis for caching, secure secrets and HTTPS. On Railway, all of that is ready with one click. Migrations run when the app starts, Postgres and Redis keep their data on volumes, and the app sits behind automatic HTTPS, so you can use it from your phone as an installed app.

**Save your security token.** By default, Ghostfolio signs you in with a **security token** instead of an email and password. When you click **Get Started**, Ghostfolio shows your token once. Store it in a password manager: it's the only way back into the account. The first account created becomes the admin.

Typical cost: **~$5–10/month** on Railway for Ghostfolio, Postgres and Redis, with unlimited portfolios and holdings. Sharesight Standard costs $18/month billed yearly, or $24 monthly.

---

## Deploy Ghostfolio in Under 5 Minutes

1. Click **Deploy on Railway**. Postgres, Redis and Ghostfolio start, and the database schema is created (about 2–3 minutes).
2. Open your Railway URL and click **Get Started** to create the first user, who gets the admin role.
3. Copy the security token Ghostfolio shows you into your password manager.
4. Under **Accounts**, add your brokerage, bank and crypto accounts with their currencies.
5. Add transactions manually or import a CSV or JSON file, then watch performance, allocation and dividends update.

No brokerage logins. No data selling. No holding limits.

---

## Common Use Cases

- **Self-hosted Sharesight alternative.** Track performance and dividends across brokers without per-holding pricing.
- **Net worth tracking.** Combine stocks, ETFs, crypto, cash and other assets in one dashboard.
- **Dividend investing.** See dividend income and total return, not just price changes.
- **Multi-currency portfolios.** Hold assets in different currencies and view everything in your base currency.
- **FIRE planning.** Follow savings, allocation and progress toward financial independence.
- **Portfolio risk checks.** Ghostfolio's static analysis flags concentration and other potential risks.
- **Family finances.** Separate accounts for each family member on one private server.
- **Private finance data.** Keep investment history off third-party platforms entirely.

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `JWT_SECRET_KEY` | 🔐 Auto-generated | Signs login sessions. Changing it signs everyone out. |
| `ACCESS_TOKEN_SALT` | 🔐 Auto-generated | Salt for security tokens. Never change it, or existing tokens stop working. |
| `DATABASE_URL` | ✅ Auto-injected | Postgres connection used by Prisma, over the private network. |
| `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD` | ✅ Auto-injected | Redis connection for the cache. |
| `ROOT_URL` | ✅ Auto-injected | Public URL of the app, from your Railway domain. Update it for a custom domain. |
| `PORT`, `HOST` | ✅ Set | `3333` and `0.0.0.0`, where Ghostfolio listens. |
| `API_KEY_COINGECKO_DEMO` | Optional | A free CoinGecko Demo key for more reliable crypto prices. |
| `ENABLE_FEATURE_AUTH_OIDC` | Optional | Turn on OpenID Connect sign-in (with the `OIDC_*` variables) instead of security tokens. |
| `ENABLE_FEATURE_MCP` | Optional | Experimental MCP server at `/mcp`, so an AI client can read your portfolio. |

**Close sign-ups after you're in.** As admin, open the **Admin Control** panel and turn off user sign-up once your accounts exist, so nobody else can create an account on your public URL.

**Market data sources.** Yahoo Finance covers most stocks, ETFs and funds. CoinGecko covers crypto, and works better with a free Demo API key. For anything without a price feed (property, private equity, a savings account), use **Manual** and update the value yourself.

---

## Ghostfolio on Railway vs. Alternatives

| | Ghostfolio on Railway | Sharesight | Ghostfolio Premium | Empower Personal Dashboard |
|---|---|---|---|---|
| **Monthly cost** | ~$5–10 usage | Free (10 holdings), $7–23.25 paid (annual) | Paid yearly | Free dashboard |
| **Self-hosted** | ✅ Yes | ❌ No | ❌ Hosted by Ghostfolio | ❌ No |
| **Holding limits** | ✅ None | ❌ 10 free, 30 on Starter | ✅ None | ✅ None |
| **Brokerage login required** | ✅ No, manual or import | ⚠️ Optional broker sync | ✅ No | ❌ Account linking |
| **Your data on your server** | ✅ Your Postgres | ❌ Hosted | ❌ Hosted | ❌ Hosted |
| **Dividends and total return** | ✅ Yes | ✅ Yes | ✅ Yes | ⚠️ Basic |
| **License** | ✅ AGPL-3.0 | ❌ Proprietary | ✅ AGPL-3.0 core | ❌ Proprietary |

---

## Dependencies for Ghostfolio Hosting

- Railway account. The Hobby plan ($5/month including $5 of usage) runs a personal instance.
- Your transaction history, entered manually or exported from your broker as CSV.
- Optional: a free CoinGecko Demo API key for crypto prices.

### Deployment Dependencies

- [Ghostfolio on GitHub](https://github.com/ghostfolio/ghostfolio): source code, releases and self-hosting guide
- [Ghostfolio website](https://ghostfol.io): features, demo and FAQ
- [Ghostfolio Docker image](https://hub.docker.com/r/ghostfolio/ghostfolio): published tags
- [Railway Volumes Documentation](https://docs.railway.com/volumes): persistence for Postgres and Redis

### Implementation Details

The official `ghostfolio/ghostfolio` image runs the NestJS API and serves the Angular client on port 3333. On start, Prisma applies database migrations and seeds reference data, so upgrades update the schema automatically. Redis caches market data and queues background jobs such as price gathering. The app container keeps no state, so redeploys are safe.

The image tracks `latest`. Ghostfolio releases often; pin a version tag if you want to control upgrades, and back up Postgres first.

---

## Frequently Asked Questions

**What is Ghostfolio, and why self-host it?**
Ghostfolio is an open-source app for tracking investments and net worth across brokers and currencies. Self-hosting keeps your financial data private, on a server you control, with no holding limits.

**How much does it cost compared to Sharesight?**
About $5–10/month on Railway with unlimited holdings. Sharesight's free plan allows 10 holdings, Starter is $7/month (annual) for 30, and Standard is $18/month for unlimited.

**I lost my security token. How do I get back in?**
The token is the login, so store it safely. An admin can open the Admin Control panel and generate a new token for a user. If the admin token is lost, it can only be recovered from the database.

**Do I lose my portfolio when Railway redeploys?**
No. Accounts, transactions and settings are stored in Postgres on its volume, and Redis keeps its cache on a volume. Redeploys and upgrades keep everything.

**Does Ghostfolio connect to my broker automatically?**
No. You add transactions yourself or import them from CSV or JSON, so no brokerage logins are shared. Prices update automatically from Yahoo Finance and CoinGecko.

**Can several people use one Ghostfolio server?**
Yes. Each person creates their own account with its own token. After everyone has joined, disable sign-up in the admin panel.

---

## Why Deploy and Host Ghostfolio 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 Ghostfolio on Railway, you get a private, unlimited portfolio and net worth tracker on your own database, available on every device, for a few dollars a month.


## 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/ghostfolio-portfolio-tracker
