Deploy GitHub Readme Stats

Get dynamically generated GitHub stats on your READMEs!

Deploy GitHub Readme Stats

Just deployed

Deploy and Host GitHub Readme Stats on Railway

GitHub Readme Stats is a popular open-source tool that dynamically generates customizable SVG cards displaying your GitHub profile statistics, such as total stars, commits, pull requests, contributions, top languages, and more. Embed these eye-catching cards directly into your README for an impressive, always-up-to-date profile showcase.

About Hosting GitHub Readme Stats

This Railway template deploys a self-hosted instance of GitHub Readme Stats using a lightweight Docker image that automatically fetches the latest code from the original repository on startup. The container runs a Node.js server exposing endpoints to generate stats cards via simple URL queries (e.g., /api?username=yourname). To operate reliably, you'll need to provide a GitHub Personal Access Token (PAT) to bypass public API rate limits, and strongly consider whitelisting usernames to prevent abuse on your public endpoint. The setup is stateless by design—no persistent volumes needed on /repo—for smooth deploys and restarts. Once live, access your instance at the Railway-provided domain for private or shared stats generation.

Common Use Cases

  • Personal GitHub profile enhancement with custom, up-to-date stats cards in your README
  • Private self-hosted stats for organizations or teams avoiding public rate limits
  • Embedding dynamic stats in personal websites, portfolios, or documentation

Dependencies for GitHub Readme Stats Hosting

You can configure the container using the following environment variables:

VariableDescriptionDefault
PAT_1Required. Your GitHub Personal Access Token. You can add PAT_2, PAT_3, etc., to increase your rate limit.None
WHITELISTStrongly Recommended. Comma-separated list of usernames allowed to use the instance. Set this to your own username to prevent abuse.null (Open to everyone)
GITHUB_README_STATS_REPOThe git repository URL to clone.https://github.com/anuraghazra/github-readme-stats.git
GITHUB_README_STATS_REFThe branch, tag, or commit hash to use.master
FIX_AUDITRun npm audit fix before starting the server.true
PORTThe internal port the Node server listens on.9000

Creating a Personal Access Token (PAT)

For deploying your own instance of GitHub Readme Stats, you will need to create a GitHub Personal Access Token (PAT). Below are the steps to create one and the scopes you need to select for both classic and fine-grained tokens.

Selecting the right scopes for your token is important in case you want to display private contributions on your cards.

Classic token

Fine-grained token

  • Strongly recommended: Username whitelist to restrict access and prevent abuse

Deployment Dependencies

Implementation Details

In Railway, after deploying the template:

  • Add environment variable PAT_1 with your GitHub PAT (created following the steps above)
  • Add WHITELIST with comma-separated usernames (e.g., your GitHub username)
  • Optional: Set GITHUB_README_STATS_REF to a specific tag (e.g., v6.0.0) for stability instead of master
  • Railway automatically sets PORT, so the app will listen on it—no need to override unless custom
  • Test: Visit https://your-service.up.railway.app/api?username=anuraghazra

Why Deploy GitHub Readme Stats 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 GitHub Readme Stats 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
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh