Skip to main content

Install Polr Link Shortener with Docker Compose

Polr is a quick, modern, and open-source link shortener. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. Visit the Polar website.

If MySQL is not already setup, run this stack to install it for Polr to connect to a DB.

version: '3'
 
services:
  db:
    image: mysql:5.7
    container_name: db
    environment:
      MYSQL_ROOT_PASSWORD: supersecretdbpass0rd
      MYSQL_DATABASE: polr
      MYSQL_USER: root
      MYSQL_PASSWORD: supersecretdbpass0rd
    ports:
      - "3306:3306"
    volumes:
      - /docker/mysql:/var/lib/mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: pma
    links:
      - db
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    restart: always
    ports:
      - 8099:80
volumes:
  dbdata:

Use this docker stack.

version: '3.3'
services:
    polr:
        ports:
            - '8080:8080'
        environment:
            - DB_HOST=192.168.1.100:3306 #your docker host IP
            - DB_DATABASE=polr
            - DB_USERNAME=root
            - DB_PASSWORD=supersecretdbpass0rd
            - APP_ADDRESS=yourdomainhere.com
            - ADMIN_USERNAME=admin
            - ADMIN_PASSWORD=admin
            - SETTING_ADV_ANALYTICs=true
        image: ajanvier/polr

Visit your Polr app at yourdomain.com