Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
FREEDOM251

Freedom251 › Blog › DevOps

How to Deploy Multiple Dokku Apps on Different Domains (HTTP, HTTPS, DNS, and Port Mapping)

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Dokku can host several independent applications on one server while all of them use the public HTTP and HTTPS ports. The reliable pattern is to give every app a unique hostname, point each DNS record to the server, deploy each app under its own Dokku app name, and assign its domain with the domains plugin. Dokku’s nginx virtual hosts then route app1.example.com and app2.example.net to different containers, even when those containers listen on different internal ports.

How Dokku routes several apps through ports 80 and 443

A Dokku host has one public network interface, but it does not need one public port per application. Incoming requests arrive at nginx on ports 80 (HTTP) or 443 (HTTPS). nginx examines the request hostname and forwards it to the Dokku app whose domain list contains that hostname. Each app keeps its own container, process configuration, environment, deployment history and proxy mapping.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, these requests can share one server:

  • https://app1.example.com routes to the container running app1.
  • https://app2.example.net routes to the container running app2.
  • https://api.example.com can route to a third app, provided that hostname is assigned to it.

The public ports remain 80 and 443. The container ports can differ, such as app1 listening on 3000 and app2 on 8080. Dokku’s proxy layer maintains the per-app mapping. There is no published Dokku statistic that defines a maximum number of applications per host; the practical limit depends on the server’s CPU, memory, storage, network capacity and the workloads you deploy.

Choose the hostname arrangement before deploying

Decide whether each application will use a separate registered domain, a subdomain under one domain, or several hostnames for one application. The choice affects DNS administration, certificates and how independently you can operate each app.

#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized
Arrangement Example DNS responsibility Certificate implication Operational fit
Separate domains app1.example.com and app2.example.net You control DNS for each domain and point every name to the Dokku server Each app’s certificate covers the names in that app’s domain list Strong separation for unrelated products, teams or customers
Subdomains of one domain app1.example.com and app2.example.com One DNS zone contains records for all apps Each app can still have its own certificate for its assigned hostname Convenient when one organization owns the whole namespace
Multiple names on one app www.example.com and example.com Both names must resolve to the server and be assigned to the same app The certificate must include every assigned name; re-enable certificate provisioning after changes Useful for aliases, canonical redirects or an additional customer domain

Dokku’s global domain supplies defaults for newly configured apps. The subdomain is inferred from the pushed application name, while the domain suffix is set during initial Dokku configuration. Explicit per-app domains override those defaults, so use domains:set when the hostname must be precise or when apps use different parent domains.

Prerequisites and a safe deployment plan

  • A Dokku server with a public IPv4 address and, if used, a public IPv6 address.
  • Administrative access to create DNS records and run Dokku commands on the host.
  • A unique Dokku app name for every application.
  • A deployable source repository, Dockerfile or Docker image. Dokku supports Heroku buildpacks, Dockerfiles and Docker images.
  • DNS A records, and AAAA records when IPv6 is enabled, for every hostname.
  • An application that listens on the port Dokku maps for it. If it uses a non-standard container port, plan to verify the proxy mapping after deployment.

Use a written inventory before you start. Record the Dokku app name, every hostname, the DNS record type and target, the expected container port, and whether the app needs HTTP only or HTTPS. This prevents a common mistake: configuring a certificate or domain for a name that still points somewhere else.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 1: Point every domain or subdomain at Dokku

Create an A record for each hostname that targets the Dokku server’s public IPv4 address. Add an AAAA record only when the server is reachable over IPv6 and your firewall and application path support it. For separate domains, repeat this in each domain’s DNS zone. For subdomains, add records such as app1 and app2 to the parent zone.

Wait until public DNS resolves each name to the Dokku host before attempting normal HTTP routing or automated certificate issuance. Dokku’s deployment documentation specifically requires all app domains to point to the server’s public IP for automated Let’s Encrypt validation. A stale record, an old hosting provider’s address or a conflicting AAAA record can cause validation to reach the wrong machine.

  • Check the A record from more than one network if possible.
  • Check the AAAA record separately; an incorrect IPv6 target can make some clients fail even when IPv4 works.
  • Do not assume that a DNS change is visible everywhere immediately; verify the authoritative zone and allow normal DNS caching to expire.

Step 2: Create and deploy each Dokku app

Use a different Dokku app name for each application. The app name is part of the Git remote and is also used by Dokku when it creates the application’s resources.

Deploy the first repository

  1. From the local repository for the first application, add a Dokku remote: git remote add dokku dokku@SERVER:app1.
  2. Push the branch you deploy: git push dokku main.
  3. Let Dokku build and release the application using its buildpack, Dockerfile or image workflow.

Deploy the second repository

  1. From the second application’s repository, add a separate remote: git remote add dokku dokku@SERVER:app2.
  2. Push its branch: git push dokku main.
  3. Confirm that the second build completes independently of the first app.

If both repositories are on the same workstation, keep the remotes in the correct repository. Accidentally pushing the second codebase to app1 updates app1 rather than creating a new application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 3: Assign one or more domains to every app

Set the primary hostname for each app on the Dokku host:

dokku domains:set app1 app1.example.com
dokku domains:set app2 app2.example.net

When an app needs an additional hostname, add it without replacing the existing list:

dokku domains:add APP extra.example

Use domains:set when you want to replace the app’s domain list with a deliberate set of names. Use domains:add for an alias such as a www hostname, a legacy name or a second customer-controlled domain. Every name in the list must have DNS pointing to this Dokku server before it can be reached correctly.

Verify the domain list

dokku domains:report app1
dokku domains:report app2

The report is the authoritative check that Dokku has stored the names you intended. If a hostname is missing, correct the domain list before troubleshooting browsers or certificates. If the report contains an unwanted default domain, replace the list explicitly with domains:set.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
RasTech Raspberry Pi 5 8GB Kit 64GB Edition with Active Cooler,27W GaN 5.1V5A USB-C Power Supply,Pi5 8GB Board,64GB Card Readers Kit,Pi 5 Case,Dual 4K Micro HD Out Cables and User Manual
  • Pi5 8GB Pack: RasTech Pi 5 8GB kit includes 1 x Pi5 8GB board ,1 x 64GB Card, 2 x Card Readers,1 x Active Cooler,1 x Case for Pi5, 2 x 4K Micro HD Out Cable,1 x GaN 27W 5A USB-C Power supply,1 x Screwdriver and 1 x instructions.
  • Pi5 8GB Board: The Pi5 board is equipped with a 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz and an 800MHz VideoCore VII GPU with support for OpenGL ES 3.1 and Vulkan 1.2, which delivers a significant increase in graphics performance. Dual HD Out 4Kp60 display outputs and a built-in dual 4-channel MIPI camera/display transceiver provide state-of-the-art camera support. The Pi 5 offers a 2-3 times increase in CPU performance compare to Pi4.
  • Important Graphics Features: Equipped with an 800MHz VideoCore VII GPU and providing better graphics performance, suitable for multimedia applications,gaming,and graphics intensive tasks.Provides 1 UART interface,1 card slot that supports high-speed operation, 2 USB. 3 0.5 ports that support synchronous 0Gbps operation,2 USB 2.0 port ports,2 4Kp60 display outputs that support HDR.Built-in dedicated dual 4-channel 1Gbps MIPI DSI/CSI connectors,triple the total bandwidth.
  • Cooling Kit for Pi 5: Compatible with Active Cooler for Raspberry Pi5, It can provide Pi 5 board with better cooling effect in using. The Case can accurately access usb-c power jack,Micro HD Out ports, usb ports, Ethernet jack, card slot, power button, 4-lane MIPI DSI/CSI connectors and so on, and it also supports installation of cooling fan.
  • 64GB Card Kit and GaN 27W USB-C Power Supply: With extra 64GB card to store more files and card readers for multiple medium, keep better performance for Raspberry Pi 5, 27W USB C Power Supply is Compatible with Pi5 8GB, offers a variety of output voltage options, including 5.1V at 5A, 9.0V at 3.0A, 12.0V at 2.25A, and 15.0V at 1.8A, providing for different device requirements.

Step 4: Verify proxy and container-port mappings

Most web applications expose the port expected by Dokku’s normal proxy configuration. Problems appear when an application listens on a non-standard container port or when a domain was added before the application was deployed. Dokku warns that a domain configured before deployment may create a mapping that does not automatically match a later non-standard port.

Inspect each app’s mapping:

dokku ports:report app1
dokku ports:report app2

Compare the reported mapping with the port on which the application actually listens inside its container. A mapping such as http:80:3000 means public HTTP traffic is accepted on port 80 and forwarded to container port 3000. For HTTPS, the equivalent pattern is https:443:3000. The exact internal port must match the application process; changing only the external URL does not make a process listening on 8080 respond on 3000.

When the mapping is wrong

  • Confirm the application’s listen port in its runtime or start command.
  • Inspect the output of dokku ports:report APP and identify the target container port.
  • Correct the Dokku port configuration using the port-management commands appropriate to your installed Dokku version, then redeploy or restart the app as required.
  • Recheck the report and test the hostname again after nginx reloads.

Do not solve a hostname collision by assigning another public port when the goal is ordinary domain-based hosting. Multiple apps can share 80 and 443; they need distinct hostnames and correct internal mappings, not separate public HTTP ports.

Step 5: Enable HTTPS for each app

Automated HTTPS is optional. Dokku can also use imported certificates, but automated Let’s Encrypt issuance requires every domain on the app to resolve to the server’s public IP. Install the optional Let’s Encrypt plugin, configure its global email address, and then enable it separately for each app.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
dokku letsencrypt:enable app1
dokku letsencrypt:enable app2

The plugin requests certificates for the names in each app’s domain list and reloads nginx after successful issuance. Enable certificates only after DNS is live and the app’s HTTP route works; otherwise validation can fail because the challenge reaches the wrong server or an incorrect port mapping.

Adding a hostname after HTTPS is enabled

A certificate’s subject-alternative-name list must contain every hostname you expect clients to use. When you add or change domains, run dokku letsencrypt:enable APP again so the certificate is reissued with the updated names. Merely adding a name with domains:add does not retroactively expand an already issued certificate.

Apply this sequence whenever an app gains an alias:

  1. Add the DNS record and wait for it to resolve to the Dokku server.
  2. Add the hostname with dokku domains:add APP new.example.
  3. Verify the complete list with dokku domains:report APP.
  4. Run dokku letsencrypt:enable APP again.
  5. Test both the original and new HTTPS names.

Complete two-app command pattern

The following is a compact sequence for two repositories. Replace the placeholders with your server, app names, domains and actual branch.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
# Deploy app1
git remote add dokku dokku@SERVER:app1
git push dokku main

# Deploy app2
git remote add dokku dokku@SERVER:app2
git push dokku main

# Assign separate hostnames
dokku domains:set app1 app1.example.com
dokku domains:set app2 app2.example.net

# Inspect domains and proxy mappings
dokku domains:report app1
dokku domains:report app2
dokku ports:report app1
dokku ports:report app2

# Enable certificates after DNS is live
dokku letsencrypt:enable app1
dokku letsencrypt:enable app2

The commands do not infer your DNS records, application listen ports or certificate requirements. Those values must match the deployment you actually made.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting by symptom

The hostname shows another site or a default response

  • Check the hostname’s A and AAAA records; one may still point to an old server.
  • Run dokku domains:report APP and confirm the exact spelling of the hostname.
  • Check that no other Dokku app owns the same domain.
  • Allow DNS caches to expire, then test again.

HTTP reaches the app but HTTPS fails

  • Confirm the Let’s Encrypt plugin completed successfully for that app.
  • Check that every assigned name resolves to this server; certificate validation covers the whole domain list.
  • If the domain list changed, run dokku letsencrypt:enable APP again.
  • Inspect the app’s port report for an incorrect HTTPS target.

The app returns a proxy error or connection refusal

  • Verify that the process is listening on the container port Dokku reports.
  • Check whether the app binds to the container interface rather than only to localhost.
  • Correct the non-standard mapping and redeploy or restart as appropriate.

Only some users can reach the site

  • Compare IPv4 and IPv6 DNS results. An incorrect AAAA record can affect IPv6-capable clients while IPv4 tests pass.
  • Check firewall rules for both public ports 80 and 443.
  • Retest after DNS propagation and certificate issuance have completed.

Operational decisions that prevent future outages

Keep app names and domains predictable

Use a consistent naming scheme such as customer-portal, api and staging. Map each name to an explicit hostname instead of relying indefinitely on the global domain default. This makes migrations and audits easier.

Best Value
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
  • Fully assembled for plug-and-play operation
  • Includes Raspberry Pi 5 with 8GB RAM
  • 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
  • M.2 HAT+
  • CanaKit Turbine Black Case for the Pi 5

Separate production and non-production hostnames

Give staging and production different domains or subdomains and separate Dokku app names. A deployment to staging then cannot accidentally replace the production app’s code or domain mapping.

Track every alias

Keep a list of all names assigned with domains:add. Removing a DNS record without removing the Dokku domain can leave a stale certificate name or an unexpected routing rule. When an alias is retired, update DNS, the Dokku domain list and the certificate configuration together.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remember that routing isolation is not resource isolation

Separate Dokku apps receive separate routing and deployment configuration, but they still share the host’s physical resources. CPU, memory, disk and network contention can affect every app. Dokku’s official documentation does not publish a universal app-per-server limit or performance benchmark, so size the server for your actual workload and monitor it in operation.

Checklist before declaring the deployment complete

  • Every app has a unique Dokku app name.
  • Every hostname has the correct A record, and an AAAA record only when IPv6 is intentionally supported.
  • DNS resolves each hostname to the Dokku server’s public address.
  • Each repository was pushed to the intended Dokku Git remote.
  • dokku domains:report APP shows the complete, correct domain list.
  • dokku ports:report APP matches the application’s actual container listen port.
  • HTTP requests route to the intended app on port 80.
  • Let’s Encrypt is enabled for every app that needs HTTPS.
  • After any domain change, certificate enablement was run again.
  • Both IPv4 and IPv6 paths, if enabled, have been tested.

What to remember

Deploying multiple domains on one Dokku server is a hostname-routing problem, not a public-port allocation problem. Deploy each application under a unique app name, point every DNS name to the server, assign explicit per-app domains, verify internal port mappings, and issue certificates only after DNS is correct. nginx can then serve many independent apps through ports 80 and 443 while Dokku forwards each request to the correct container.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 5
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
Fully assembled for plug-and-play operation; Includes Raspberry Pi 5 with 8GB RAM; 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
$339.97

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DevOpsDNSDockerDokkuLet’s EncryptNGINXself-hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.