selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

lua.sh logo

Self-host lua.sh

1.0.5

Open-source URL shortener with analytics on your domain

ReleaseOpen SourceAGPL-3.0
Updatedlast month
LanguagePHP
Setup difficultyAdvanced
MobileResponsive
ThemeDark mode
Stars
342
Requires
PostgreSQL, Redis
Install with Build from Source
Analytics dashboard showing click statisticsEvents view in light modeEvents view in dark mode

What is lua.sh?

lua.sh is a next-generation URL shortener designed for individuals and teams who want branded, trackable short links on their own domains. It shortens URLs with custom slugs, generates QR codes, supports link expiration and password protection, and organizes links into tagged workspaces. The analytics dashboard shows every click with geographic, device, browser, and referrer data retained indefinitely. The stack is Laravel (PHP) on the backend with PostgreSQL and Redis, and Vue 3 with Inertia.js and TailwindCSS on the frontend. It ships with a REST API that mirrors all UI actions and an MCP server at /mcp for AI assistants, both authenticated via Laravel Passport OAuth. Optional integrations include Google and GitHub social sign-in and PostHog product analytics. The project is licensed AGPL-3.0 and explicitly supports self-hosting with documented installation steps using Composer and npm. Dark mode is available in the UI.

Should you self-host lua.sh?

lua.sh scores 50/100 on selfhost.directory (how scoring works) and ranks #10 of 23 in URL Shortener. It has 342 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is advanced: plan for several services and some ongoing maintenance. It is AGPL-3.0-licensed and written mostly in PHP.

Its closest alternative on selfhost.directory is dub-links (74/100, 24 961 stars). It scores higher overall, so compare the two before you pick. See lua.sh vs dub-links side by side.

Features

  • Click Analytics
  • Custom domains
  • Custom URL Slugs
  • iOS/Android Destination Routing
  • Link expiration
  • MCP Server
  • Password Protection
  • QR codes
  • REST API
  • Social sign-in
  • Team Workspaces
  • URL Shortening

lua.sh README

How to install lua.sh

Install lua.sh with Build from Source

composer install npm install

cp .env.example .env php artisan key:generate

OAuth signing keys for the API and the MCP server. These are gitignored,

so every environment generates its own — without them the api guard

rejects every token.

php artisan passport:keys

php artisan migrate --seed

npm run dev

Requires PHP, Composer, Node.js, PostgreSQL, Redis

How to configure lua.sh

  • APP_DEBUGtrueEnable debug mode

    Enable debug mode

  • APP_ENVlocalApplication environment

    Application environment

  • APP_KEYApplication encryption key

    Application encryption key

  • APP_NAMELaravelApplication name

    Application name

  • APP_URLhttp://localhostApplication URL

    Application URL

  • DB_CONNECTIONpgsqlDatabase connection type

    Database connection type

  • DB_DATABASEluaDatabase name

    Database name

  • DB_HOST127.0.0.1Database host

    Database host

  • DB_PASSWORDDatabase password

    Database password

  • DB_PORT5432Database port

    Database port

  • DB_USERNAMEpostgresDatabase username

    Database username

  • GITHUB_CLIENT_IDGitHub OAuth client ID

    GitHub OAuth client ID

  • GITHUB_CLIENT_SECRETGitHub OAuth client secret

    GitHub OAuth client secret

  • GOOGLE_CLIENT_IDGoogle OAuth client ID

    Google OAuth client ID

  • GOOGLE_CLIENT_SECRETGoogle OAuth client secret

    Google OAuth client secret

  • MAPBOX_TOKENMapbox token for analytics map

    Mapbox token for analytics map

  • POSTHOG_API_KEYPostHog API key

    PostHog API key

  • POSTHOG_ENABLEDfalseEnable PostHog analytics

    Enable PostHog analytics

  • REDIS_HOST127.0.0.1Redis host

    Redis host

  • REDIS_PORT6379Redis port

    Redis port

lua.sh releases & version history

More in Link Management

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…