Fork: 872 Star: 1341 (更新于 2024-05-28 12:46:42)

license: 暂无

Language: Shell .

This project contains a Docker image meant to facilitate the deployment of Nacos .

最后发布版本: v2.3.2 ( 2024-04-03 15:38:24)


Nacos Docker

Docker Pulls

This project contains a Docker image meant to facilitate the deployment of Nacos.



The following environment variables have been removed from the default values in the new version(Nacos 2.2.1) for the sake of system security, please add them yourself when starting up, otherwise an error will be reported at startup.


Project directory

  • build:Nacos makes the source code of the docker image
  • env: Environment variable file for compose yaml
  • example: Docker compose example for Nacos server


  • The database master-slave image has been removed, after the latest nacos/nacos-server:latest image. For specific reasons, refer to Removing the Master-Slave Image Configuration
  • Since Nacos 1.3.1 version, the database storage has been upgraded to 8.0, and it is backward compatible
  • If you use a custom database, you need to initialize the database script yourself for the first time.

Quick Start

docker run --name nacos-quick -e MODE=standalone -p 8848:8848 -p 9848:9848 -d nacos/nacos-server:v2.2.0

Advanced Usage

  • Tips: You can change the version of the Nacos image in the compose file from the following configuration. example/.env

Run the following command:

  • Clone project

    git clone --depth 1
    cd nacos-docker
  • Standalone Derby

    docker-compose -f example/standalone-derby.yaml up
  • Standalone Mysql

    # Using mysql 5.7
    docker-compose -f example/standalone-mysql-5.7.yaml up
    # Using mysql 8
    docker-compose -f example/standalone-mysql-8.yaml up
  • Standalone Nacos Cluster

    docker-compose -f example/cluster-hostname.yaml up 
  • Service registration

    curl -X POST ''
  • Service discovery

    curl -X GET ''
  • Publish config

    curl -X POST ""
  • Get config

      curl -X GET ""
  • Open the Nacos console in your browser


Common property configuration

name description option
MODE cluster/standalone cluster/standalone default cluster
NACOS_SERVERS nacos cluster address eg. ip1:port1 ip2:port2 ip3:port3
PREFER_HOST_MODE Whether hostname are supported hostname/ip default ip
NACOS_APPLICATION_PORT nacos server port default 8848
NACOS_SERVER_IP custom nacos server ip when network was mutil-network
SPRING_DATASOURCE_PLATFORM standalone support mysql mysql / empty default empty
MYSQL_SERVICE_PORT mysql database port default : 3306
MYSQL_SERVICE_DB_NAME mysql database name
MYSQL_SERVICE_USER username of database
MYSQL_SERVICE_PASSWORD password of database
MYSQL_DATABASE_NUM It indicates the number of database default :1
MYSQL_SERVICE_DB_PARAM Database url parameter default :characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false
JVM_XMS -Xms default :1g
JVM_XMX -Xmx default :1g
JVM_XMN -Xmn default :512m
JVM_MS -XX:MetaspaceSize default :128m
JVM_MMS -XX:MaxMetaspaceSize default :320m
NACOS_DEBUG enable remote debug y/n default :n
TOMCAT_ACCESSLOG_ENABLED server.tomcat.accesslog.enabled default :false
NACOS_AUTH_SYSTEM_TYPE The auth system to use, currently only 'nacos' is supported default :nacos
NACOS_AUTH_ENABLE If turn on auth system default :false
NACOS_AUTH_TOKEN_EXPIRE_SECONDS The token expiration in seconds default :18000
NACOS_AUTH_TOKEN Note: It is removed from Nacos 2.2.1
NACOS_AUTH_CACHE_ENABLE Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay. default : false
MEMBER_LIST Set the cluster list with a configuration file or command-line argument eg:,,
EMBEDDED_STORAGE Use embedded storage in cluster mode without mysql embedded default : none
NACOS_AUTH_CACHE_ENABLE nacos.core.auth.caching.enabled default : false
NACOS_AUTH_USER_AGENT_AUTH_WHITE_ENABLE nacos.core.auth.enable.userAgentAuthWhite default : false
NACOS_AUTH_IDENTITY_KEY nacos.core.auth.server.identity.key Note: It is removed from Nacos 2.2.1
NACOS_AUTH_IDENTITY_VALUE nacos.core.auth.server.identity.value Note: It is removed from Nacos 2.2.1
NACOS_SECURITY_IGNORE_URLS default : /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
NACOS_CONSOLE_UI_ENABLED nacos.console.ui.enabled default : true
NACOS_CORE_PARAM_CHECK_ENABLED nacos.core.param.check.enabled default : true
DB_POOL_CONNECTION_TIMEOUT Database connection pool timeout in milliseconds default : 30000

Advanced configuration

If the above property configuration list does not meet your requirements, you can mount the file into the /home/nacos/init.d/ directory of the container, where the spring properties can be configured, and the priority is higher than file

If you have a lot of custom configuration needs, It is highly recommended to mount in production environment.

For example:

docker-compose -f example/custom-application-config.yaml up -d

Nacos + Grafana + Prometheus

Usage reference:Nacos monitor-guide

Note: When Grafana creates a new data source, the data source address must be http://prometheus:9090

最近版本更新:(数据更新于 2024-07-17 14:31:59)

2024-04-03 15:38:24 v2.3.2

2024-03-04 16:01:18 v2.3.1

2024-01-23 14:56:34 v1.4.7

2023-12-06 15:16:38 v2.3.0

2023-06-12 19:34:30 v1.4.6

2023-06-02 09:55:33 v2.2.3

2023-04-14 16:11:46 v2.2.2

2023-04-14 15:56:23 v1.4.5

2023-03-21 18:45:13 v2.1.2

2023-03-21 18:37:00 v2.1.1

nacos-group/nacos-docker同语言 Shell最近更新仓库

2024-07-18 22:26:19 binpash/try

2024-07-18 17:51:15 RROrg/rr

2024-07-18 11:03:26 SeleniumHQ/docker-selenium

2024-07-18 09:28:13 jumpserver/installer

2024-07-18 01:57:19 datalens-tech/datalens

2024-07-18 00:31:28 nextcloud/docker