Installation
vanityURLs runs entirely on infrastructure you already control — a GitHub repository, a domain name, and a free Cloudflare account. There is nothing to install on your machine beyond the optional CLI helper script.
Quick setup
Create a repository from the template
From the vanityURLs GitHub repository, click Use this template → Create a new repository.
Choose a name that reflects your short domain (e.g. my-tiny.link). Select Private — your redirect list may contain internal URLs.
Create your Cloudflare account
If you don’t have one already, follow the Cloudflare account creation guide. The free plan is sufficient.
Purchase your internet domain
Log into Cloudflare and register a short domain via Domains → Register. Type your desired name, search, and complete the purchase. Enable Auto-renew before leaving.
You can also transfer an existing domain to Cloudflare DNS.
Create the Cloudflare Pages site
- In the Cloudflare dashboard, click Add a Pages site and connect your GitHub repository.
- Configure the build:
<pre class="bg-gray-900 text-gray-100 p-4 text-sm font-mono overflow-x-auto"><code>
Framework preset: (leave empty) Build command: cat static.lnk dynamic.lnk > build/_redirects Build output directory: /build
- Set up a custom domain for the Pages project pointing to your purchased domain.
Warning
static.lnk, dynamic.lnk, and build/_headers in the next step.Local configuration
Configure vanityURLs.conf
Edit vanityURLs.conf in your repository (or run make config if you prefer vi):
SCRIPT_DIR=/usr/local/bin # path where the lnk script will be installed
REPO_DIR=~/repos/my-tiny.link # path to your local clone of the repo
MY_DOMAIN=my-tiny.link # your short domain
MY_PAGE=my-project.pages.dev # your Cloudflare Pages project URL
Run initial setup
make setup
This generates:
build/_headers— security and cache headers based on your domain and Pages URLstatic.lnk— your static redirect list (initially redirects/to your main site)dynamic.lnk— your dynamic redirect list (initially empty)
Add your first redirects
Edit static.lnk with your preferred text editor, or use the lnk script:
lnk add /github https://github.com/yourname
lnk add /linkedin https://linkedin.com/in/yourname
Commit and push
git add -A && git commit -m "add initial redirects" && git push
Cloudflare detects the push and deploys in ~15 seconds. Your links are live.
Verify
Open https://your-domain/github in a browser — you should be redirected to your GitHub profile.