A modern, minimalist, and lightweight URL shortener.
Polr is an intrepid, self-hostable open-source link shortening web application with a robust API. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. Polr is especially easy to use, and provides a modern, themable feel.
Notice: The containerization effort for Polr is in active development here
You can launch Polr with the provided
docker-compose file, or by running the container by itself and using your own mysql server. Either way, once you start this container up and visit it's in your browser, you'll be presented with the following (I've changed the values to reflect this my template values):
Polr isn't configured to use env variables or secrets just yet. I should really jump on that... Instead, the best we can do is spin up a MySQL instance next to Polr and manually configure it.
version: '2' services: polr: image: james9074/polr:latest volumes: - /data/polr/web:/data links: - db:db ports: - 80:80/tcp db: image: mysql environment: MYSQL_DATABASE: polr MYSQL_PASSWORD: polr-password MYSQL_ROOT_PASSWORD: super-secure-pw MYSQL_USER: polr volumes: - /data/polr/db:/var/lib/mysql
Note: Polr itself just needs a MySQL instance running somewhere to work. The
docker-compose file above installs myself along side Polr, but if you don't use that, you'll need to have a mysql instance running somewhere with the database pre-created.
#!/bin/bash # Remove any existing polr container docker kill polr-container docker rm polr-container # Deploy the polr container on port 80, mounted to a host volume at /data/polr docker run -d \ -p 80:80 \ --name polr-container \ --volume /data/polr:/data \ james9074/polr:latest
I get an error message directly after submitting the config info on the setup page, and the site is broken
This is 90% likely an issue with your mysql user/pw. The official mysql image doesn't allow root to connect externally, so make sure you're configuring Polr to use your
MYSQL_PASSWORD. If it fails the connection, Polr won't gracefully tell you to correct your settings, yet. You'll need to wipe the Polr volume and start over, for now.