Self-hosting Apidog
  1. Configuration
Self-hosting Apidog
  • Installation
    • Installation Overview
    • Obtaining Apidog On-premises License
    • Running Apidog on Docker
    • Running Apidog on Kubernetes
    • Running Apidog Multi-Container Deployment without Kubernetes
    • Admin Panel
    • Installing Apidog Client
    • Backing up Apidog
    • Renewing Apidog
    • Updating Apidog
    • Supported browsers
    • Privacy
  • Configuration
    • Environment Variables
    • Configuring the application database
    • Configuring the application storage service
    • Using LDAP for authentication
    • Using OKTA for authentication
    • Using OAuth2.0 for authentication
  • Apidog API (coming soon)
  • Troubleshooting
    • Troubleshooting
    • FAQ
  1. Configuration

Environment Variables

Basic Configuration#

Please be aware that environment variable values are case-sensitive.
Environment VariableDescriptionDefault ValueOther
BASE_URLThis specifies the protocol (http/https), IP address, or domain name required to access the API service. For example, it might be "https://api.example.com" or "http://192.168.0.13:80".
SERVER_BASE_PATHServer base path (e.g., /apidog), this requires LICENSE authorization. Please provide this path to Apidog staff when applying for LICENSE.Optinal
MYSQL_HOSTMySQL server address
MYSQL_PORTMySQL server port3306
MYSQL_DATABASEDatabase name
MYSQL_USER_NAMEMySQL username
MYSQL_PASSWORDMySQL user password
REDIS_HOSTRedis server address
REDIS_PORTRedis server port6379
REDIS_PASSWORDRedis password, can be empty
REDIS_DBRedis DB, generally set to 00
REDIS_TLS_ENABLEDRedis TLS connectionfalse
JWT_SECRETSecret key used to sign JSON Web Tokens for requests to /api/ endpoints, must be between 10-50 characters in length. On a Linux or macOS system, You can run the following command to generate one: openssl rand -base64 32
LICENSEServer authorization license, contact Apidog staff to obtain
ADMIN_USERNAMEAdministrator account for Admin Panel
ADMIN_PASSWORDAdministrator password for Admin Panel

System Email Configuration (Optional)#

Please be aware that environment variable values are case-sensitive.
System email is utilized for sending the password reset emails upon requests via the 'Forgot Password' function.
Environment VariableDescriptionDefault Value
MAILER_HOSTSMTP server address
MAILER_PORTSMTP port
MAILER_SECUREWhether to use SSL, optional values: true, false
MAILER_USERSender's email address
MAILER_PASSWORDSender's email password
Please attempt to access the MAILER_HOST within the container using the following command:
nc -vz $MAILER_HOST $MAILER_PORT
If the configuration is correct, the output should resemble the following:
Connection to smtp.gmail.com port 465 [tcp/urd] succeeded!
If network restrictions are preventing the connection, the output may resemble the following:
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)#

Please be aware that environment variable values are case-sensitive.
Environment VariableDescriptionDefault ValueOther
NOT_FOUND_PAGE_URLThis configuration sets the redirection URL for backend service 404 errors.
The URL must be a relative path that begins with a '/'.
/help/index.htmlOptional

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#

Please be aware that environment variable values are case-sensitive.
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#

Please be aware that environment variable values are case-sensitive.
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#

Please be aware that environment variable values are case-sensitive.
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#

Please be aware that environment variable values are case-sensitive.
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.
Previous
Privacy
Next
Configuring the application database
Built with