Operations 7 min read

How to Install and Deploy Nacos 2.3.2 on Windows and Linux – Full Production Guide

This step‑by‑step guide explains how to install Nacos 2.3.2 on Windows and Linux, covering version requirements, hardware recommendations, Docker‑Compose quick start, MySQL integration, production cluster topology, security hardening, monitoring with Prometheus, common troubleshooting, and clean uninstallation.

Ray's Galactic Tech
Ray's Galactic Tech
Ray's Galactic Tech
How to Install and Deploy Nacos 2.3.2 on Windows and Linux – Full Production Guide

Overview

Nacos is an open‑source dynamic service discovery, configuration, and service management platform from Alibaba. The guide adds version‑matching advice, one‑click Docker deployment, production cluster topology, security hardening, and monitoring instructions.

Version and Environment Requirements

Nacos version 2.3.2 (compatible with Spring Cloud Alibaba 2023.0.0.0 and Spring Cloud 2023.0.x, JDK 1.8+).

Supported JDK: 1.8 or higher.

Recommended hardware: at least 2 GB RAM (4 GB+ for production), 2‑CPU cores (4 cores+ for production), SSD storage with persistent data directory.

Windows Installation

Download the latest stable zip package from the Nacos GitHub releases page (e.g., nacos-server-2.3.2.zip).

Extract the archive to a non‑Chinese path, e.g., D:\nacos.

Optionally modify the port in conf/application.properties (e.g., server.port=8849).

Start Nacos in standalone mode:

cd D:
acos\bin
startup.cmd -m standalone

Open a browser at http://localhost:8848/nacos. Default credentials are nacos / nacos.

Linux Installation

Download and extract the tarball:

wget https://github.com/alibaba/nacos/releases/download/2.3.2/nacos-server-2.3.2.tar.gz
tar -xvf nacos-server-2.3.2.tar.gz
mv nacos /usr/local/

Install Java 1.8 if missing: yum install java-1.8.0-openjdk -y Set environment variables:

echo 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk' >> /etc/profile
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile
source /etc/profile

Start Nacos in standalone mode:

cd /usr/local/nacos/bin
sh startup.sh -m standalone

Docker‑Compose Quick Start (Recommended for Local Development)

version: "3"
services:
  nacos:
    image: nacos/nacos-server:2.3.2
    container_name: nacos
    environment:
      - MODE=standalone
    ports:
      - "8848:8848"
    volumes:
      - ./nacos-data:/home/nacos/data

Run docker compose up -d to launch.

MySQL Configuration (Strongly Recommended for Production)

Create a database:

CREATE DATABASE nacos_config CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Import the initialization script:

mysql -u root -p nacos_config < /usr/local/nacos/conf/nacos-mysql.sql

Update conf/application.properties:

spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=yourpassword

Production Cluster Deployment

Typical topology uses an Nginx load balancer in front of three Nacos nodes (each on port 8848) and a MySQL master‑slave cluster for persistence.

┌──────────────┐
        │   Nginx LB   │
        └──────┬───────┘
               │
   ┌───────────┼───────────┐
   │           │           │
 Node1:8848  Node2:8848  Node3:8848
   │           │           │
   └──────→ MySQL master‑slave cluster ←───┘

Configure cluster.conf with the IP:port of each node, e.g.:

192.168.1.101:8848
192.168.1.102:8848
192.168.1.103:8848

Security Hardening

Change the default password via the console (Permission Control → User List).

Set an authentication token secret key (32‑byte random string, Base64‑encoded):

nacos.core.auth.plugin.nacos.token.secret.key=Base64EncodedRandomString

Enable HTTPS:

server.ssl.enabled=true
server.ssl.key-store=classpath:keystore.p12
server.ssl.key-store-password=changeit
server.ssl.keyStoreType=PKCS12

Monitoring and Operations

Enable Actuator endpoints: management.endpoints.web.exposure.include=* Expose Prometheus metrics at /nacos/actuator/prometheus and import the official Grafana dashboard (ID 12453).

Common Issues

Port conflict: modify server.port in conf/application.properties.

Cannot access console: open firewall port 8848 (e.g., firewall-cmd --add-port=8848/tcp --permanent).

Ubuntu startup error: use bash startup.sh instead of sh startup.sh.

Uninstall

sh shutdown.sh
rm -rf /usr/local/nacos
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerOpsNacosmysqlInstallationproduction
Ray's Galactic Tech
Written by

Ray's Galactic Tech

Practice together, never alone. We cover programming languages, development tools, learning methods, and pitfall notes. We simplify complex topics, guiding you from beginner to advanced. Weekly practical content—let's grow together!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.