Ghostfolio

Track your stocks, ETFs, and crypto with a privacy-first, self-hostable wealth management platform built for data-driven investors.

8.9Kstars
1.2Kforks
GNU AGPLv3
TypeScript

Ghostfolio is an open source wealth management application that gives individuals full control over their investment data while delivering institutional-grade portfolio analytics. It tracks stocks, ETFs, and cryptocurrencies across multiple broker accounts, calculates Return on Average Investment across any timeframe, and surfaces portfolio composition insights without requiring spreadsheets or paid financial services.

Built on a modern TypeScript stack with Angular, NestJS, Prisma, and PostgreSQL managed inside an Nx monorepo, Ghostfolio is designed for continuous self-hosted operation. It ships official Docker images for amd64, arm/v7, and arm64 architectures, supports Redis-backed background data gathering queues, and integrates with multiple market data providers including CoinGecko, Yahoo Finance, and Alpha Vantage. Recent releases have added an AI assistant powered by OpenRouter models that analyzes your holdings in natural language.

Privacy is a first-class design principle: users own their data entirely, authentication can be handled via JWT tokens or experimental OpenID Connect, and an impersonation mode lets users share a read-only view of their portfolio without exposing credentials. A Premium cloud offering provides managed hosting and professional data providers for users who prefer not to self-host, with revenue funding ongoing open source development.

With over 8,700 GitHub stars, weekly release cadence since 2021, more than 264 contributors, and a Slack community, Ghostfolio is one of the most actively maintained personal finance tools in the open source ecosystem.

What You Get

  • Portfolio Performance Analytics - Track Return on Average Investment (ROAI) across seven timeframes (Today, WTD, MTD, YTD, 1Y, 5Y, Max) with interactive charts and historical comparisons.
  • Multi-Account Management - Consolidate investments from multiple brokers or platforms into a single unified dashboard with per-account and aggregate performance views.
  • Transaction Import & Export - Create, update, and delete buy/sell/dividend transactions manually or via bulk CSV and JSON import, with full export capabilities for data portability.
  • X-ray Portfolio Analysis - Run automated static analysis to identify concentration risks, asset class imbalances, and diversification gaps with customizable rule thresholds.
  • Watchlist & Benchmarks - Track assets outside your portfolio via a watchlist and compare performance against benchmark indices for relative context.
  • AI Portfolio Assistant - Ask natural language questions about your holdings via an integrated AI assistant powered by configurable OpenRouter models including Claude and GPT-4.
  • FIRE Calculator - Model financial independence timelines with a built-in FIRE (Financial Independence, Retire Early) calculator that uses your actual portfolio data.
  • Progressive Web App with Dark & Zen Mode - Install Ghostfolio on mobile or desktop as a native-like PWA with offline support, dark theme, and a distraction-free Zen Mode.
  • Self-Hosting via Docker - Deploy with official multi-arch Docker images (amd64, arm/v7, arm64) and a Docker Compose configuration covering the app, PostgreSQL, and Redis.
  • OpenID Connect Authentication - Integrate with external identity providers like Keycloak or Auth0 using experimental OIDC support alongside traditional JWT-based auth.

Common Use Cases

  • Consolidating a multi-broker portfolio - An investor holding positions across multiple brokers imports all transactions into Ghostfolio to view unified performance metrics and true asset allocation percentages in one place.
  • Replacing investment spreadsheets - A buy-and-hold investor migrates from manually maintained Excel files to Ghostfolio to automate market data updates, eliminate calculation errors, and visualize long-term compound growth.
  • Privacy-conscious wealth tracking - A developer who distrusts cloud-based financial apps self-hosts Ghostfolio on a home server or VPS to retain full ownership of sensitive portfolio data without sharing it with third-party services.
  • Running portfolio analysis on a Raspberry Pi - A hobbyist investor deploys Ghostfolio on a Raspberry Pi using the arm64 Docker image, giving a family member a private dashboard for tracking their retirement investments.
  • Evaluating financial independence progress - A professional targeting FIRE uses the built-in calculator and X-ray analysis together to model early retirement timelines and identify over-concentrated positions that increase sequence-of-returns risk.
  • Sharing a read-only portfolio view - A financial mentor uses Ghostfolio’s impersonation link to share a sanitized view of their portfolio allocations with mentees without exposing transaction details or account balances.

Under The Hood

Architecture Ghostfolio is organized as an Nx monorepo containing four discrete applications and shared libraries: an Angular single-page application, a NestJS REST API, and shared TypeScript libraries for common utilities, UI components, and API interfaces. The backend follows clean layered architecture with NestJS modules enforcing separation between controllers, services, and data access. Portfolio calculation is handled by an abstract PortfolioCalculator base class with concrete implementations for ROAI and TWR methodologies, factored out into a strategy pattern via a PortfolioCalculatorFactory. Redis-backed Bull queues handle asynchronous data gathering and portfolio snapshot computation, keeping request latency low by pre-computing expensive aggregations in the background. Prisma migrations manage the PostgreSQL schema with a well-normalized data model covering accounts, activities, asset profiles, market data, subscriptions, and user settings.

Tech Stack The backend runs on Node.js with NestJS and Express, using Prisma for type-safe PostgreSQL access and Redis via @keyv/redis and Bull for caching and job queuing. The frontend is Angular with Angular Material and Bootstrap utility classes, compiled as a PWA with Angular Service Worker. The monorepo is managed by Nx with configured target defaults for build, test, and lint pipelines. Market data integrates with Yahoo Finance, CoinGecko (Demo and Pro), Alpha Vantage, EOD Historical Data, Financial Modeling Prep, and Google Sheets as pluggable providers. An AI assistant endpoint uses the OpenRouter SDK with the Vercel AI SDK’s generateText function, making the LLM model configurable at runtime. Deployment uses multi-stage Docker builds that embed Prisma schema generation, with Docker Compose orchestrating the full stack.

Code Quality The codebase has comprehensive unit and integration tests covering portfolio calculation, benchmark services, helper utilities, and UI components, with well-structured mock dependencies using Jest. The abstract PortfolioCalculator is extensively tested across dozens of scenario-specific spec files covering partial sells, dividends, currency conversions, and edge cases. Error handling uses explicit NestJS exception patterns with HTTP status codes, and the data import pipeline validates inputs with class-validator before processing. TypeScript strict mode is enforced across the entire monorepo via a shared tsconfig.base.json, with consistent ESLint and Prettier configurations. A LogPerformance decorator instruments critical calculation paths with method-level timing without requiring external APM tooling.

What Makes It Unique Ghostfolio’s pluggable data provider abstraction — with implementations for seven different market data sources including a self-hosted scraper and a Ghostfolio-proprietary provider — lets the community add new integrations without modifying core business logic. The combination of multiple performance calculation methodologies (ROAI, TWR, MWR) behind a unified API is unusual in personal finance tools and reflects genuine depth in investment accounting semantics. The recent addition of an AI portfolio assistant that sends your actual holdings as a structured table to a configurable LLM model is a practical and privacy-respecting approach to natural-language portfolio analysis. The impersonation system — allowing read-only portfolio sharing via a tokenized link — addresses a real social use case absent from most self-hosted finance tools.

Self-Hosting

Ghostfolio is released under the GNU Affero General Public License v3.0 (AGPL-3.0). In plain terms, the AGPL grants you the right to use, modify, and self-host the software freely, including for commercial purposes, but comes with a network copyleft requirement: if you modify Ghostfolio and make it available to others over a network (including as a hosted service), you must release your modifications under the same license. For individuals and organizations self-hosting for internal use only, there are no copyleft obligations — you can run a modified version privately without disclosing changes. This makes AGPL a strong choice for personal use but one that requires careful evaluation before building a paid service on top of it.

Running Ghostfolio yourself requires maintaining three infrastructure components: a PostgreSQL database, a Redis instance, and the application container itself. The official Docker Compose setup bundles all three, making initial deployment straightforward, but ongoing operations — database backups, schema migrations on upgrades, Redis persistence configuration, and SSL termination via a reverse proxy — remain your responsibility. The application reads market data from external APIs (Yahoo Finance, CoinGecko, etc.), so network reliability and API rate limits affect data freshness. Ghostfolio updates weekly with a disciplined semantic versioning cadence, meaning you will need to apply upgrades regularly to receive bug fixes and security patches. The DEVELOPMENT.md and CHANGELOG.md provide migration guidance for breaking changes.

Ghostfolio Premium, the official managed cloud offering, removes all infrastructure burden and provides access to professional data providers with higher rate limits and better coverage for international securities. Premium subscribers also receive priority support through official channels and fund continued open source development. For users who do not want to manage a multi-container stack with database backups and rolling upgrades, the cloud tier is meaningfully more reliable and lower-maintenance, though it requires trusting a third-party service with financial transaction data — the exact trade-off that motivates many users to self-host in the first place.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search