Skip to content

Deployment Overview of Dokku on Server

Prerequisites and Basic Requirements

  • Operating System: Ubuntu

  • Privileges: Root access or sudo privileges are required to execute installation and management commands.

  • Domain: A DNS record must point to the configured domain name for the application.

  • Ports: Port 443 (HTTPS) is the designated external port for incoming traffic.

FQDN of the Final Panel

The application is accessible via the Fully Qualified Domain Name (FQDN) constructed with the following format: <prefix><Server ID>.hostkey.in:443

Based on the configuration parameters:

  • Zone: hostkey.in

  • Prefix: dokku

  • Example FQDN: dokku<Server ID>.hostkey.in

Application Installation Process

The application is deployed using the official Dokku bootstrap script with a specific version pinned to ensure consistency.

  • Version: v0.34.8

  • Installation Script: bootstrap.sh

  • Installation Steps:

  • Download the bootstrap script to /tmp/bootstrap.sh from the official Dokku repository.

  • Execute the installation using the following command:

    sudo DOKKU_TAG=v0.34.8 bash /tmp/bootstrap.sh
    

  • Set the global domain for the Dokku instance:

    dokku domains:set-global dokku<Server ID>.hostkey.in
    

  • Install core dependencies for the Dokku environment:

    dokku plugin:install-dependencies --core
    

Docker Containers and Their Deployment

The reverse proxy and SSL certificate management are handled by Docker containers orchestrated via Docker Compose.

  • Directory: /root/nginx

  • Orchestration File: compose.yml

  • Container Image: jonasal/nginx-certbot:latest

  • Deployment Command:

    docker compose up -d
    
    This command is executed within the /root/nginx directory.

Container Configuration

The Docker Compose setup includes the following specifications:

Parameter Value / Description
Service Name nginx
Image jonasal/nginx-certbot:latest
Restart Policy unless-stopped
Network Mode host
Environment Variable [email protected]
Env File /data/nginx/nginx-certbot.env
Volume Mounts - nginx_secrets mounted to /etc/letsencrypt
- /data/nginx/user_conf.d mounted to /etc/nginx/user_conf.d

Proxy Servers

The nginx-certbot container serves as the reverse proxy, handling HTTPS termination and SSL certificate management via Let's Encrypt.

  • Proxy Configuration Directory: /etc/nginx/user_conf.d (mapped from /data/nginx/user_conf.d)

  • SSL Certificates Location: /etc/letsencrypt (mapped from nginx_secrets volume)

  • Certificate Email: [email protected]

  • External Port: 443

  • Internal Path Mapping: /

Permission Settings

Specific directories are configured with defined ownership and permissions to ensure the services function correctly:

  • Directory: /root/nginx

  • Owner: root

  • Group: root

  • Mode: 0755

  • File: /root/nginx/compose.yml

  • Owner: root

  • Group: root

  • Mode: 0644

Location of Configuration Files and Data

  • Dokku Domain Configuration: Managed globally via the dokku domains:set-global command.

  • Docker Compose File: /root/nginx/compose.yml

  • Nginx User Configuration Directory: /data/nginx/user_conf.d

  • Certbot Environment Variables: /data/nginx/nginx-certbot.env

  • SSL Secrets Volume: Mapped to /etc/letsencrypt inside the container.

Available Ports for Connection

  • Port 443: Secure HTTPS traffic for the Dokku application and proxy.
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×