Skip to content
OpenClaw 不踩坑恶意 Skills ,企业需 Skills Registry:Nacos 3.2 发布Know more

Nacos Quick Start

This Quick Start Guide helps you quickly download, install, and use Nacos on your computer.

0. Version Selection

You can find the features supported by each version through Nacos’s version download page, release notes, and release announcements. The currently recommended stable version for production environments is 3.1.1.

1. Prerequisites

Nacos relies on a Java environment to run. Please ensure you have the following environment set up:

  1. 64-bit OS, supporting Linux/Unix/Mac/Windows. Linux/Unix/Mac is recommended.
  2. 64-bit JDK 17+; Download & Configure.

2. Download and Start Nacos

nacos-setup provides one-click automated deployment, automatically handling download, authentication configuration, port detection, and Java environment verification.

Install nacos-setup:

curl -fsSL https://nacos.io/nacos-installer.sh | sudo bash

Start Nacos:

Terminal window
# One-click deploy the latest standalone Nacos
nacos-setup
# One-click deploy a specific version of standalone Nacos
nacos-setup -v 3.1.1
# One-click deploy the latest Nacos cluster
nacos-setup -c cluster
# Configure external storage globally, enter database address, port, username and password, then re-run nacos-setup
nacos-setup --datasource-conf

For more usage, please refer to One-Click Deployment with nacos-setup.

2.2. Manual Download and Deployment

2.2.1. Download the Package

You can obtain the Nacos distribution package through the Nacos official website or Github.

Go to the Nacos official version download page, select a stable version, and click ${nacos.version}.zip in the Binary Package Download column to download.

Note: When many users are downloading simultaneously, you may encounter download rate limiting. If this happens, please wait and try again, or use the Github download method.

2.2.2. Extract the Nacos Distribution Package

Terminal window
unzip nacos-server-$version.zip
# or tar -xvf nacos-server-$version.tar.gz
cd nacos/bin

2.2.3. Start the Server

  • Note: Nacos is recommended to run on machines with at least 2 CPU cores, 4GB RAM, and 60GB disk space.

Start command (standalone means running in standalone mode, not cluster mode):

sh startup.sh -m standalone

If you are using Ubuntu, or the script reports an error about the [[ symbol not found, try running: bash startup.sh -m standalone

The startup program will then prompt you to enter 3 authentication-related configurations (since Nacos 3.0.0, console authentication is enabled by default, so the following 3 authentication configurations must be filled in):

`nacos.core.auth.plugin.nacos.token.secret.key` is missing, please set with Base64 string: ${your_input_token_secret_key}
nacos.core.auth.plugin.nacos.token.secret.key` Updated:
----------------------------------
`nacos.core.auth.server.identity.key` is missing, please set: ${your_input_server_identity_key}
`nacos.core.auth.server.identity.key` Updated:
----------------------------------
`nacos.core.auth.server.identity.value` is missing, please set: ${your_input_server_identity_key}
`nacos.core.auth.server.identity.value` Updated:
----------------------------------

3. Verify Nacos Service Started Successfully

Navigate to the ${nacos.home}/logs/ directory and use tail -f start.out to view the logs. If you see the following log, the service has started successfully.

Nacos started successfully in stand alone mode. use embedded storage

You can use the following services to quickly verify Nacos functionality.

3.1. Nacos Console Page

Open any browser and enter the address: http://127.0.0.1:8080/index.html to access the Nacos console page.

Note: The first time you open it, you will be asked to initialize the password for the admin user nacos.

3.2. Service Registration

curl -X POST 'http://127.0.0.1:8848/nacos/v3/client/ns/instance?serviceName=quickstart.test.service&ip=127.0.0.1&port=8080'

3.3. Service Discovery

curl -X GET 'http://127.0.0.1:8848/nacos/v3/client/ns/instance/list?serviceName=quickstart.test.service'

3.4. Publish Configuration

Terminal window
# Login to obtain access token
curl -X POST 'http://127.0.0.1:8848/nacos/v3/auth/user/login' -d 'username=nacos' -d 'password=${your_password}'
# Use access token to create configuration
curl -X POST 'http://127.0.0.1:8848/nacos/v3/admin/cs/config?dataId=quickstart.test.config&groupName=test&content=HelloWorld' -H "accessToken:${your_access_token}"

3.5. Get Configuration

curl -X GET 'http://127.0.0.1:8848/nacos/v3/client/cs/config?dataId=quickstart.test.config&groupName=test'

4. Shutdown Server

4.1. Linux/Unix/Mac

sh shutdown.sh

4.2. Windows

shutdown.cmd

Or double-click the shutdown.cmd file to run it.