Self-hosting Apidog
  1. Docker Deployment
Self-hosting Apidog
  • Overview
  • Introduction
    • Obtaining Apidog On-Premises License
    • System Requirements
    • Data Privacy & Compliance
  • Deployments
    • Docker Deployment
      • Standalone Docker Deployment
      • Hybrid Docker Deployment
      • Multi-Containers Docker Deployment
    • Kubernetes Deployment
      • Deploying Apidog on Kubernetes using Helm
      • Deploying Apidog on Kubernetes using Deployment Manifest
  • Post Deployment
    • Accessing Apidog Admin Panel
    • Accessing Apidog Web Interface
    • Installing Apidog On-Premises Client
  • Configurations
    • Environment Variables
    • Database Configuration
    • Storage Services Configuration
    • Git Connection Configuration
    • Authentication Providers
      • Using LDAP for Authentication
      • Using OKTA for Authentication
      • Using OAuth2.0 for Authentication
  • Maintenance & Upgrades
    • Updating Apidog
    • Backing up Apidog
    • License Renewal
    • System Design Flow
  • Troubleshooting
    • Troubleshooting
    • FAQ
  • Apidog API (coming soon)
  1. Docker Deployment

Multi-Containers Docker Deployment

Overview#

This guide outlines the procedure for deploying a clustered Apidog environment using Docker. This architecture employs Nginx as a reverse proxy and load balancer to distribute traffic across multiple Apidog application nodes, ensuring higher availability and horizontal scalability.
Prerequisite
Before proceeding, ensure you are familiar with the standard Running Apidog on Docker. Refer to the documentation Standalone Docker Deployment and Hybrid Docker Deployment.

Requirements & Prerequisites#

To successfully deploy a multi-node cluster, your infrastructure must meet the following requirements:

System Requirements#

Docker Version 20.10.0 or higher is required. We recommend the latest stable release (e.g., 26.x).
Verify version: docker --version
Hardware & Software: For hardware and software requirement, please refer to the System Requirements documentation.

External Dependencies#

Database: A PostgreSQL or MySQL instance. See Database Configuration.
Storage: An S3-compatible object storage service. See Storage Services Configuration
Docker Registry Access: Ensure you have the Access Token (received via email) to pull the private image.

Preparation: Image Pull#

Authenticate with Docker Hub using the credentials provided by the Apidog support team to access the private enterprise image.
1.
Log in to Docker Hub manually to verify credentials
2.
Pull the Image
Enter your Access Token (password) when prompted for the password and pull the specific image tag:

Database Initialization#

This guide utilizes a MySQL database. If you are using PostgreSQL, please refer to the PostgreSQL Guidelines
Apidog does not automatically create the database. You must manually connect to your database instance to initialize the database. Once connected, execute:

Apidog Node Setup#

Deployment Script#

Step 1: Create the startup script run-apidog.sh.
Step 2: Press i to enter insert mode and paste the following content, ensuring you populate the environment variables with your external database credentials. For more information on the environment variables and how to configure them, please refer to the Environment Variables guide. Save and exit (:wq).
Step 3: Execute the script to start the application node.

Gateway & Load Balancer Setup (Nginx)#

This section configures an Nginx container to handle SSL termination and distribute traffic to the backend nodes configured in Section 2.

Nginx Gateway Setup#

Step 1: Create an initialization script init-nginx.sh.
Step 2: Press i to enter insert mode and paste the following contents, then save and exit (:wq).
Step 3: Execute the script.
Step 4: Copy the configuration files to your host.

SSL Configuration#

Prepare your SSL certificates for secure HTTPS access.
Step 1: Create the certificate directory:
Step 2: Add your certificate and key files:

Load Balancer Configuration#

Modify the Nginx default.conf to define the upstream backend pool.
Press i to enter insert mode, and replace the file content with the configuration below. Ensure the upstream backend block contains the IP addresses and ports of the Apidog nodes.

Start the Gateway#

Create the production startup script for Nginx using the mounted configurations.
Press i to enter insert mode and paste the following contents. Save and exit (:wq)
Finally, execute the script:

Updating Apidog#

Concurrency Warning
Initial deployments, along with subsequent system upgrades, may necessitate modifications to the database schema or involve data migration procedures. It is critical to note that these migration tasks are not designed to be executed concurrently.
Deployment Strategy
To mitigate potential issues, it is advisable to deploy a dedicated container specifically for performing the upgrade operations. Once the migration is successfully completed, the containers responsible for handling live traffic can be updated accordingly.

Run the application#

To run the application, refer to the documentations:
Accessing Apidog Web Interface
Accessing Apidog Admin Panel
Installing Apidog On-Premises Client

Other Resources#

Using LDAP for Authentication
Using OKTA for Authentication
Using OAuth2.0 for Authentication
Troubleshooting Guide
Configuration Guide
Updating Apidog
Backing up Apidog
License Renewal
Modified at 2025-12-17 06:52:11
Previous
Hybrid Docker Deployment
Next
Deploying Apidog on Kubernetes using Helm
Built with