Docker Compose

Docker Compose Template

For those of you running Linux servers or if you use docker-compose, then you can install Pterodactyl-Node/Wings and Panel using our docker-compose.yml file example.

Creating folders

Let's create the folders that will have a compose file in each of them.

mkdir -p /opt/appdata/pterodactyl-panel
mkdir -p /opt/appdata/pterodactyl-node

Pterodactyl Panel

Now let's create the first docker-compose.yml file with the nano text editor.

nano /opt/appdata/pterodactyl-panel/docker-compose.yml

You can uncomment the Traefik labels if you're using our Traefik set up.

version: '3.8'
services:
  pterodactyl-panel:
    image: ccarney16/pterodactyl-panel:latest
    container_name: pterodactyl-panel
    hostname: pterodactyl-panel
    restart: unless-stopped
    networks:
      - proxy
    ports:
      - "8001:80"
    volumes:
      - "/opt/appdata/pterodactyl-panel/appdata/:/data" #Appdata of Container
      - "/opt/appdata/pterodactyl-node:/etc/pterodactyl" #Appdata - #Where config.yml goes into.
      - "/opt/appdata/pterodactyl-node/data:/mnt/appdata/pterodactyl-node/data" #Shared data between Panel and Node/Wings.
      - "/opt/appdata/pterodactyl-panel/nginx/:/etc/nginx/conf.d/" #Nginx Config
    environment:
      APP_ENV: "production"
      APP_ENVIRONMENT_ONLY: "false"
      APP_SERVICE_AUTHOR: "EMAIL"
      APP_URL: "https://SUB.DOMAIN.COM"
      APP_TIMEZONE: "America/New_York"       # A list of valid timezones can be found here: http://php.net/manual/en/timezones.php
      CACHE_DRIVER: "redis" #DON'T TOUCH
      SESSION_DRIVER: "redis" #DON'T TOUCH
      QUEUE_DRIVER: "redis" #DON'T TOUCH
      REDIS_HOST: REDIS-HOST
      REDIS_PORT: REDIS-PORT
      REDIS_USER: "admin"
      REDIS_PASSWORD: REDIS-PASSWORD
      MAIL_FROM: "EMAIL"
      MAIL_DRIVER: "smtp"
      MAIL_HOST: "smtp.gmail.com"
      MAIL_PORT: "587"
      MAIL_USERNAME: "ACCOUNT-GMAIL"
      MAIL_PASSWORD: "APP_PASSWORD"
      MAIL_ENCRYPTION: “true”
      APP_DEBUG: “false”
      TRUSTED_PROXIES: "*"
      DB_HOST: DATABASE-HOST/IPV4 OF UNRAID OR HOST SYSTEM.
      DB_PORT: DATABASE-PORT
      DB_USER: "DATABASE-USER"
      DB_PASSWORD: DATABASE-PASSWORD
      DB_DATABASE: "DATABASE-USERNAME"
    #labels:
    #  - "traefik.enable=true"
    #  - "traefik.http.routers.pterodactyl_panel.entryPoints=https"
    #  - "traefik.http.routers.pterodactyl_panel.rule=Host(`${PANEL.DOMAIN.COM}`)"
    #  - "traefik.http.services.pterodactyl_panel.loadbalancer.server.port=80"

networks:
  proxy:
    driver: bridge
    external: true

After you're done editing the file, save it with ctrl+x, type “y” and then press enter.

Pterodactyl Node/Wings

Now let's create the second docker-compose.yml file with the same text editor.

nano /opt/appdata/pterodactyl-node/docker-compose.yml
version: '3.8'
services:
  wings:
    image: ccarney16/pterodactyl-daemon:latest
    container_name: pterodactyl-wings
    hostname: pterodactyl-wings
    restart: unless-stopped
    networks:
      - proxy
    ports:
      - "2022:2022"
      - "8181:8080"
    tty: true
    environment:
      TZ: "America/New_York"
      WINGS_UID: 1000
      WINGS_GID: 1000
      WINGS_USERNAME: USER
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock" #docker.sock
      - "/opt/appdata/pterodactyl-node/data:/mnt/appdata/pterodactyl-node/data" #Shared data between Panel and Node/Wings.
      - "/opt/appdata/pterodactyl-node:/etc/pterodactyl" #Appdata - #Where config.yml goes into.
      - "/opt/appdata/pterodactyl-node/tmp:/tmp/pterodactyl" #tmp
    #labels:
    #  - "traefik.enable=true"
    #  - "traefik.http.routers.pterodactyl_wings.entryPoints=https"
    #  - "traefik.http.routers.pterodactyl_wings.rule=Host(`${NODE.DOMAIN.COM}`)"
    #  - "traefik.http.services.pterodactyl_wings.loadbalancer.server.port=443"

networks:
  proxy:
    driver: bridge
    external: true

Close and save this file by pressing ctrl+x, type “y” and then press enter.

Deploy the Container

Make sure you are in the same directory as the docker-compose.yml file, and now we want to start up the container(s) by running the following in each directory:

docker-compose up -d

If you're in another directory, then you will need to specify the compose file with the -f argument.

docker-compose -f /opt/appdata/pterodactyl-panel/docker-compose.yml up -d
docker-compose -f /opt/appdata/pterodactyl-node/docker-compose.yml up -d

Last updated