Railway

Deploy Short Link Tracker

URL shortening ,QR code generator,Analytics,Tracking

Deploy Short Link Tracker

Just deployed

/data

/var/lib/postgresql/data

Just deployed

Deploy and Host Short Link Tracker on Railway

Short Link Tracker is a modern URL shortening platform built with Next.js 15 that provides link management, click tracking, analytics dashboards, QR code generation, CSV exports, and customizable branding. Designed for individuals, businesses, and marketing teams, it makes it easy to create, manage, and analyze shortened links from a secure web-based administration panel.

About Hosting Short Link Tracker

Railway makes deploying Short Link Tracker simple by automatically building the application and provisioning the required services. This template requires both PostgreSQL and Redis, which Railway can provide as managed services. PostgreSQL stores links, click analytics, settings, and authentication data, while Redis accelerates frequently accessed data and analytics. Railway also manages HTTPS, deployments, networking, and environment variables, allowing you to focus on managing your short links instead of infrastructure. Once deployed, the application includes an administrator dashboard for creating links, viewing analytics, exporting reports, and customizing branding.

Common Use Cases

  • Create branded short URLs with analytics and QR codes.
  • Track marketing campaigns, referral traffic, and click performance.
  • Manage internal or public URL shortening services with an administrative dashboard.

Dependencies for Short Link Tracker Hosting

DependencyRequiredPurpose
PostgreSQLYesStores links, analytics, settings, and authentication data.
RedisYesCaches frequently accessed data and improves application performance.

Deployment Dependencies

ResourceLink
GitHub Repositoryhttps://github.com/bilalnawaz072/short-link-tracker
Next.jshttps://nextjs.org
Prisma ORMhttps://www.prisma.io
PostgreSQLhttps://www.postgresql.org
Redishttps://redis.io
MaxMind GeoLite2https://www.maxmind.com/en/geolite2/signup

Implementation Details

Docker

Railway automatically builds the application from the repository.

No Docker configuration is required.

Public Networking

SettingValue
Proxy TypeHTTP Proxy
Target Port8080

Environment Variables

Configure the following Railway Variables before deployment.

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string. Use the Railway PostgreSQL reference variable.
REDIS_URLYesRedis connection string. Use the Railway Redis reference variable.
ADMIN_PASSWORDYesAdministrator login password.
JWT_SECRETYesSecret used to sign authentication tokens.
MAXMIND_LICENSE_KEYNoEnables visitor country detection using MaxMind GeoLite2.
NODE_ENVYesApplication environment.
PORTYesInternal application port.
BASE_URLYesPublic Railway URL used for generated short links.

Raw Editor example:

DATABASE_URL=${{Postgres.DATABASE_URL}}
REDIS_URL=${{Redis.REDIS_URL}}

ADMIN_PASSWORD=${{secret(32)}}
JWT_SECRET=${{secret(32)}}

MAXMIND_LICENSE_KEY=

NODE_ENV=production
PORT=8080

BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}

Database

This template requires both PostgreSQL and Redis.

PostgreSQL

  1. Add a PostgreSQL service to your Railway project.
  2. Reference its connection string:
DATABASE_URL=${{Postgres.DATABASE_URL}}

Redis

  1. Add a Redis service to your Railway project.
  2. Reference its connection string:
REDIS_URL=${{Redis.REDIS_URL}}

Build & Start

Before the application starts, configure the following Pre-Deploy Command in Railway:

npx prisma generate && npx prisma db push

Railway automatically builds and starts the application after the database schema has been synchronized.

Persistent Storage

No Railway Volume is required.

Application data is stored in PostgreSQL, while Redis provides caching.

Accessing the Application

After deployment:

  1. Open your Railway service.
  2. Navigate to Settings → Networking.
  3. Click Generate Domain.
  4. Open your generated Railway URL.

The main application will be available at:

https://

The administrator dashboard is available at:

https:///admin

First Login

Sign in using the administrator password configured in Railway:

Username: (Not required)
Password: ADMIN_PASSWORD

The password is the value you configured for the ADMIN_PASSWORD environment variable.

Using Short Link Tracker

After logging in:

  1. Create a new shortened URL.
  2. Optionally configure:
    • Custom short code
    • Title
    • Tags
    • Expiration date
    • Click limit
  3. Generate a QR code.
  4. Share the generated short URL.
  5. Monitor analytics from the dashboard.
  6. Export click analytics as CSV when needed.

Optional GeoIP Analytics

To display visitor country information:

  1. Create a free MaxMind account.
  2. Generate a GeoLite2 License Key.
  3. Configure:
MAXMIND_LICENSE_KEY=your_license_key

If omitted, the application functions normally, but visitor country information will display as Unknown.

Features

  • URL shortening
  • Custom short codes
  • Click analytics
  • QR code generation
  • CSV export
  • Administrator dashboard
  • JWT authentication
  • Redis caching
  • PostgreSQL storage
  • Custom 404 page
  • Device and referral analytics
  • Optional GeoIP country tracking

Why Deploy Short Link Tracker 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 Short Link Tracker 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
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
35
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51