DEV Community

Junaid
Junaid

Posted on

Host an URL Shortening Service NOW!

Yes! You Can Host Your Own URL Shortening Service — and Even Build a Business on It!

How?

It’s easy! You can self-host it either locally or on the internet.

LibreShortURL

LibreShortURL is a minimalistic, privacy-friendly, and lightweight URL shortener.


Requirements

  1. Server: Python >= 3.13, Linux (containerized or any distribution)
  2. Domain: A short domain is recommended for better branding

Installation Process

  • Clone the repository:
  git clone https://github.com/junaidcodingmaster/LibreShortURL
  cd LibreShortURL
Enter fullscreen mode Exit fullscreen mode
  • Build the app on the server:
  chmod +x ./build-server.sh
  ./build-server.sh
Enter fullscreen mode Exit fullscreen mode
  • Create a configuration file (config.env):
  SERVER_DOMAIN="<YOUR DOMAIN WITH HTTP OR HTTPS>"
  SERVER_HOST=0.0.0.0
  SERVER_PORT=433

  REQ_LIMIT_PER_DAY=50
Enter fullscreen mode Exit fullscreen mode
  • Deploy the app:
  python app.py
Enter fullscreen mode Exit fullscreen mode

If you encounter any errors, you can force start with Flask:

  flask run --host "0.0.0.0" --port 433
Enter fullscreen mode Exit fullscreen mode

Customization

To customize the UI, replace the following files with your own templates or design:

  • index.html
  • styles.css
  • index.js

These files are located in the /templates folder.


Need Help?


Stay curious and explore more.
~ Junaid


Author: Junaid

Top comments (0)