---
title: "Deploy Short Link Tracker"
description: "URL shortening ,QR code generator,Analytics,Tracking"
category: "Other"
url: https://railway.com/deploy/short-link-tracker
---

# Deploy Short Link Tracker

URL shortening ,QR code generator,Analytics,Tracking

**[Deploy Short Link Tracker on Railway](https://railway.com/template/short-link-tracker)**

- **Creator:** Muhammad Bilal
- **Category:** Other

## 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

### short-link-tracker

- **Source:** bilalnawaz072/short-link-tracker
- **Public domain:** Yes

## Documentation

# 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

| Dependency | Required | Purpose |
|------------|----------|---------|
| PostgreSQL | Yes | Stores links, analytics, settings, and authentication data. |
| Redis | Yes | Caches frequently accessed data and improves application performance. |

### Deployment Dependencies

| Resource | Link |
|----------|------|
| GitHub Repository | https://github.com/bilalnawaz072/short-link-tracker |
| Next.js | https://nextjs.org |
| Prisma ORM | https://www.prisma.io |
| PostgreSQL | https://www.postgresql.org |
| Redis | https://redis.io |
| MaxMind GeoLite2 | https://www.maxmind.com/en/geolite2/signup |

### Implementation Details

## Docker

Railway automatically builds the application from the repository.

No Docker configuration is required.

## Public Networking

| Setting | Value |
|---------|-------|
| Proxy Type | HTTP Proxy |
| Target Port | 8080 |

## Environment Variables

Configure the following Railway Variables before deployment.

| Variable | Required | Description |
|----------|----------|-------------|
| `DATABASE_URL` | Yes | PostgreSQL connection string. Use the Railway PostgreSQL reference variable. |
| `REDIS_URL` | Yes | Redis connection string. Use the Railway Redis reference variable. |
| `ADMIN_PASSWORD` | Yes | Administrator login password. |
| `JWT_SECRET` | Yes | Secret used to sign authentication tokens. |
| `MAXMIND_LICENSE_KEY` | No | Enables visitor country detection using MaxMind GeoLite2. |
| `NODE_ENV` | Yes | Application environment. |
| `PORT` | Yes | Internal application port. |
| `BASE_URL` | Yes | Public Railway URL used for generated short links. |

Raw Editor example:

```env
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:

```env
DATABASE_URL=${{Postgres.DATABASE_URL}}
```

### Redis

1. Add a **Redis** service to your Railway project.
2. Reference its connection string:

```env
REDIS_URL=${{Redis.REDIS_URL}}
```

## Build &amp; Start

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

```bash
npx prisma generate &amp;&amp; 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:

```text
https://
```

The administrator dashboard is available at:

```text
https:///admin
```

## First Login

Sign in using the administrator password configured in Railway:

```text
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:

```env
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.

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/short-link-tracker
