Self-hosting Apidog
  1. Configurations
Self-hosting Apidog
  • Overview
  • Introduction
    • Obtaining Apidog On-Premises License
    • System Requirements
    • Data Privacy & Compliance
  • Deployment
    • Running Apidog on Docker
    • Running Apidog on Kubernetes
    • Running Apidog Multi-Container Deployment without Kubernetes
  • 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. Configurations

Environment Variables

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.

Basic Configuration#

Environment VariableDescriptionDefault ValueOptional
BASE_URLSpecifies the protocol (HTTP/HTTPS), IP address, or domain name to access the API service (e.g.,"https://api.example.com" or "http://192.168.0.13:80").No
SERVER_BASE_PATHDefines the base path (e.g., /apidog) for the API. This requires valid LICENSE authorization. Contact Apidog support to obtain the necessary license.Yes
MYSQL_HOSTThe host address for the MySQL server.No
MYSQL_PORTThe port on which the MySQL server listens3306No
MYSQL_DATABASEThe name of the MySQL database to which Apidog connects.No
MYSQL_USER_NAMEThe MySQL username used for authentication.No
MYSQL_PASSWORDThe password associated with the MYSQL_USER_NAME for MySQL authentication.No
REDIS_HOSTThe address of the Redis server (IP address, hostname, or domain name).No
REDIS_PORTThe port on which the Redis server listens.6379No
REDIS_PASSWORDOptional Redis password. Can be left empty if not required.Yes
REDIS_DBSpecifies the Redis database to use (typically set to 0 for the default database).0No
REDIS_TLS_ENABLEDSpecifies whether TLS encryption is enabled for Redis connections (true/false)falseNo
JWT_SECRETSecret key used to sign JSON Web Tokens (JWT) for authentication. The key must be between 10-50 characters in length. On a Linux or macOS, you can generate one using the command openssl rand -base64 32No
LICENSEThe server authorization license provided by Apidog support.No
ADMIN_USERNAMEThe administrator username for accessing the Apidog Admin Panel.No
ADMIN_PASSWORDThe administrator password for the Apidog Admin Panel.No
DB_DIALECTSpecifies the database dialect. Supported values: mysql, postgresql.mysqlYes

MySQL SSL/TLS Configuration (Optional)#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
This section outlines environment variables used for configuring SSL/TLS connections to MySQL to secure data transfer.
Environment VariableDescriptionDefault ValueOptional
MYSQL_SSL_CAPath to the CA certificate used for MySQL SSL connections.Yes
MYSQL_SSL_KEYPath to the client private key used for establishing a secure SSL connection with MySQL.Yes
MYSQL_SSL_CERTPath to the client certificate used for SSL connections with MySQL.Yes
MYSQL_SSL_SERVER_NAMEThe server name used for SNI (Server Name Indication) in the SSL handshake with MySQL.Yes
MYSQL_TLS_REJECT_UNAUTHORIZEDSpecifies whether to reject unauthorized SSL certificates during the MySQL SSL handshake. Set to true to enforce strict validation.trueYes
Note
Certificate and Key Files: You can specify certificate and key values either as file paths or direct strings. If a file exists at the given path, its contents will be used, otherwise, the value itself will be interpreted as the certificate/key.
Self-Signed Certificates: Setting MYSQL_TLS_REJECT_UNAUTHORIZED to false allows self-signed certificates or untrusted certificates. This setting is not recommended for production environments due to security risks.
These environment variables are optional and should only be configured if you require SSL/TLS for your MySQL connection.

PostgreSQL Configuration (Optional)#

This section outlines the environment variables needed to configure PostgreSQL database connections, with options for SSL/TLS for enhanced secure connections.
Version Requirement: This configurations requires Apidog image version 2.7.19 or later for PostgreSQL support.
Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
To use PostgreSQL, configure the environment variable DB_DIALECT=postgresql. For further guidance, refer to Configuring the application database.
Environment VariableDescriptionDefault ValueOptional
PG_HOSTThe address of the PostgreSQL server127.0.0.1No
PG_PORTThe port on which the PostgreSQL server is running5432No
PG_DATABASEThe name of the PostgreSQL database to connect to.No
PG_USERNAMEThe username used for authenticating with PostgreSQL.No
PG_PASSWORDThe password associated with the PostgreSQL username.No
PG_SSL_CAPath to the CA certificate for SSL connections with PostgreSQL.Yes
PG_SSL_KEYPath to the client private key used for PostgreSQL SSL connections.Yes
PG_SSL_CERTPath to the client certificate for PostgreSQL SSL connections.Yes
PG_SSL_SERVER_NAMEThe server name used for SNI (Server Name Indication) in PostgreSQL SSL connections.Yes
PG_TLS_REJECT_UNAUTHORIZEDSpecifies whether to reject unauthorized SSL certificates (true/false).trueYes
Note
Certificate/key values can be specified as file paths or direct strings.
Self-signed certificates are allowed by setting PG_TLS_REJECT_UNAUTHORIZED to false, but this is not recommended in production environments.
These variables are optional and should only be configured if SSL/TLS is required for PostgreSQL connections.

System Email Configuration (Optional)#

The system email is used to send password reset emails when a user requests a password reset via the 'Forgot Password' function.
Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
Environment VariableDescriptionDefault Value
MAILER_HOSTThe SMTP server address for email delivery.
MAILER_PORTThe SMTP server port (e.g., 465 for SSL, 587 for TLS).
MAILER_SECUREWhether to use SSL/TLS encryption for email transmission. Values: true, false.
MAILER_USERThe email address used as the sender's address.
MAILER_PASSWORDThe password for the sender's email address.

Testing Email Configuration#

To test the email connection, run the following command from within the container to check connectivity to the MAILER_HOST:
If the configuration is correct, you should see output like:
Connection to smtp.gmail.com port 465 [tcp/urd] succeeded!
In case of connection issues, you may encounter errors like:
nc: connectx to smtp.gmail.com port 465 (tcp) failed: Operation timed out

Using AWS SES#

To use AWS SES as the email provider, configure the following additional environment variables:
Required Parameters:
ParameterDefault ValueDescription
MAILER_USING_AWS_SESfalseWhether to use AWS SES (true/false)
MAILER_SES_ACCESS_KEYAWS Access Key for SES authentication.
MAILER_SES_ACCESS_SECRETAWS Secret Key for SES authentication.
Optional Parameters:
ParameterDefault ValueDescription
MAILER_SES_SENDING_RATE14Maximum emails per second.
MAILER_SES_MAX_CONNECTIONS50Maximum concurrent connections to SES.
MAILER_SES_API_VERSION'2012-10-17'The SES API version.
MAILER_SES_REGION'us-east-1'The AWS region.

Feature Configuration (Optional)#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
Environment VariableDescriptionDefault ValueOther
NOT_FOUND_PAGE_URLSets the redirection URL for backend service 404 errors. The URL must be a relative path that starts with a //help/index.htmlOptional
REPLACE_PORT_NUMBER_80Replaces the default HTTP port 80 with a non-privileged port number (greater than 1023) for HTTP access.Optional
REPLACE_PORT_NUMBER_443Replaces the default HTTPS port 443 with a non-privileged port number (greater than 1023) for HTTPS access.Optional

Collaboration and Runner Service (Optional)#

Version Requirement: Requires version 2.6.1 or later. If using the Runner container, following environment must be configured with the Apidog container for the Runner to function correctly.
Environment Variables:
Variable NameDescriptionDefault ValueRequired for Real-time Sync
RTM_QUEUE_ENABLEEnable collaboration/runner requestsfalseYes
RTM_REDIS_HOSTRedis server addressYes
RTM_REDIS_PORTRedis server portYes
RTM_REDIS_PASSWORDRedis password (optional)Yes
RTM_REDIS_DBRedis databaseYes
RTM_REDIS_TLS_ENABLEDRedis TLS connectionfalse
By default, the RTM_REDIS_(HOST|PORT|PASSWORD|DB|TLS_ENABLED) variables inherit their values from the corresponding REDIS_(HOST|PORT|PASSWORD|DB|TLS_ENABLED) variables.
Here is an example using environment variables with a Docker run command:
However, you can specify a different set of values for the RTM Redis configuration by explicitly setting these variables.
Here is a different example that explicitly setting these variables:
Gateway configuration
If you have a gateway or reverse proxy (e.g., Nginx or ALB) in front of the service, add the following configuration (remember to replace http://apidog-service.example.com with your Apidog service actual URL):
location /ws {
        proxy_pass http://apidog-service.example.com/ws;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
}

HTTPS Configuration (Optional)#

To enable HTTPS access to the server, configure the following environment variables.
If your server access protocol need to be updated from HTTP to HTTPS, please contact customer support to obtain a new license and update your BASE_URL environment variable.
Environment VariableDescriptionDefault ValueRequired
SERVER_SSL_CERTIFICATEHTTPS certificate content (use this method if not mounting the certificate file).Optional
SERVER_SSL_CERTIFICATE_KEYHTTPS certificate key content (use this method if not mounting the key file).Optional
SERVER_SSL_CERTIFICATE_FILEPath to the HTTPS certificate file within the container (required when mounting the certificate file).Optional
SERVER_SSL_CERTIFICATE_KEY_FILEPath to the HTTPS certificate key file within the container (required when mounting the key file).Optional

Using LDAP for authentication#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
Environment VariableDescriptionDefault ValueOther
LDAP_ENABLEWhether to enable LDAP login serviceSet to true to enable
LDAP_URLThe address of the LDAP service in the format ldap://ip:port. For example, ldap://127.0.0.1:389Required when LDAP is enabled
LDAP_BIND_USERThe account used to connect to LDAP. For example, cn=admin,dc=example,dc=orgRequired when LDAP is enabled
LDAP_BIND_PASSWORDThe password used to connect to LDAP. When anonymous access is disabled in LDAP, the administrator account and password must be configuredRequired when LDAP is enabled
LDAP_BASE_DNLDAP Base DN, the Base Dn used for LDAP username retrieval. For example, dc=example,dc=orgRequired when LDAP is enabled
LDAP_USER_ID_ATTRDefault is dn, based on the standard openldap LDAP service, which has a unique dn field used as the unique id for ldap user attributes; if there is a username or email, you can also configure the username (name) or email (mail)dnRequired when LDAP is enabled, if there is an email field, it is recommended to use mail first
LDAP_LOGIN_TITLEDefault is LDAP Login, the form name on the login pageLDAP LoginOptional
LDAP_USERNAME_ATTRUsed for username login, search, and display. It is recommended to keep it unique. If it appears duplicated, a random number will be added after the username. By default, it will take the uid field of openldap's standard LDAP serviceuidOptional
LDAP_USER_EMAIL_ATTREmail field used for login and search. By default, it will take the mail attribute of openldap's standard LDAP service. Private users can choose not to configure mail, and using username login will not be affectedmailOptional
LDAP_EMPLOYEE_NUMBER_ATTRMapping field for employee number, can be used for searchOptional
LDAP_SEARCH_FILTERSearch filter for ldap serviceOptional
See Using LDAP for authentication.

Using OKTA for authentication#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
Environment VariableDescriptionDefault ValueOther
OKTA_ENABLEWhether to enable Okta login serviceSupported from version v2.1.24. Set to "true" to enable, or leave blank or unset to disable
OKTA_CLIENT_IDOkta application IDMust be filled in when Okta service is enabled
OKTA_CLIENT_SECRETOkta application access secretMust be filled in when Okta service is enabled
OKTA_DOMAINOkta API access domainMust be filled in when Okta service is enabled
OKTA_LOGIN_USER_ID_ATTRDefault value is "id", used as the unique ID for Okta user attributesidOptional
See Using OKTA for authentication.

Using Amazon S3 or other S3-compatible storage services#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
Environment VariableDescriptionDefault ValueOther
STORAGE_DRIVERFile storage option. AWS S3 storage service can be configured as 's3'.fileIf not set, it will default to local file storage.
STORAGE_ACCESS_KEYAccess Key for cloud storage service.Required if STORAGE_DRIVER is set to a cloud service.
STORAGE_ACCESS_SECRETAccess Secret for cloud storage service.Required if STORAGE_DRIVER is set to a cloud service.
STORAGE_BASE_PATHRoot path of cloud storage./apidogShould start with '/'. Optional.
STORAGE_REGIONStorage region set for cloud storage service.Optional if STORAGE_DRIVER is set to a cloud service.
STORAGE_BUCKETBucket (container) name set for cloud storage service. Image access will require permissions by default.Required if STORAGE_DRIVER is set to a cloud service.
STORAGE_URL_EXPIRESExpiration time (in seconds) for authorized image access.1800Optional.
STORAGE_BASE_URLAccess domain name of the Bucket (container) set for cloud storage service, or the access path for local storage.Required.
STORAGE_CUSTOM_ENDPOINTCustom storage endpoint for cloud storage (e.g., S3 custom CNAME).Optional.
STORAGE_BUCKET_PATH_STYLECloud storage address concatenation mode (e.g., S3 path style).Optional.
PUBLIC_STORAGE_ENABLEIndicates whether the cloud storage service has a public Bucket (container) name for storing public images, where image access does not require permissions.Only effective when set to "true".
PUBLIC_STORAGE_BUCKETPublic Bucket (container) name set for the cloud storage service for storing public images.If not set, STORAGE_BUCKET will be used.
PUBLIC_STORAGE_BASE_URLAccess domain name of the public Bucket (container) set for the cloud storage service, or the access path for local storage.If not set, STORAGE_BASE_URL will be used.
Here's the optimized English version of the text, suitable for a SaaS product's technical support documentation:

Login security options#

Environment Variable Name
Description
Default Value
Notes
DISABLE_USER_REGISTRATIONDisable user registration.true when SSO is configured, otherwise false.Optional: true or false. true disables registration. If unset, the default value is used.
FORCE_SSO_LOGINEnforce SSO login only (when SSO is configured).trueOptional: true or false.
DISABLE_SSO_ACCOUNT_CREATIONPrevent automatic account creation via SSO login; only allow manual account creation in the Apidog admin panel.falseOptional: true or false.
DISABLE_REGISTERDisable the registration feature.Deprecated. Not recommended. Optional: true or false. true disables registration. If unset, registration is allowed. When enabled, only manual account creation in the admin panel is permitted (SSO login will also be prevented from creating new accounts).
PASSWORD_ERROR_RATE_LIMIT_DURATIONLogin error rate limit (time interval), in seconds.1800
PASSWORD_ERROR_RATE_LIMIT_MAXMaximum allowed login errors within the time interval.150 means no limit.
PASSWORD_TRANSFER_EXTRA_ENCRYPTIONEnable password encryption during transmission.Optional. Set to true to enable.
SECRET_KEY_FOR_COMMON_CASERSA encryption key pair.Example: [{"public":"Base64 encoded public key","private":"Base64 encoded private key"}]
APP_DOMAIN_WHITE_LISTCORS (Cross-Origin Resource Sharing) related. Set domains allowed for cross-origin access to the backend service.Supported from server version 2.3.12 onwards. Example: http://apidog.com,https://apidog.com,http://app.apidog.com

Admin Panel#

Environment variable values are case-sensitive. Please ensure that the correct capitalization is used when setting or referencing environment variables.
To activate the system Admin Panel, it is necessary to set the appropriate environment variables as follows:
The environment variable for the administrative username is: ADMIN_USERNAME
The environment variable for the administrative password is: ADMIN_PASSWORD
You can access the Admin Panel via a web browser by navigating to {BASE_URL}/admin (e.g., http://192.168.1.9/admin)
In this context, {BASE_URL} represents the address configured in the BASE_URL variable.
Modified at 2025-12-08 05:03:55
Previous
Installing Apidog On-Premises Client
Next
Database Configuration
Built with