# Installation This guide walks through installing EndSectors in a production-ready sequence and includes practical examples for both single-host and distributed deployments. Prerequisites - Java 21 runtime installed on Common and all servers. - Paper/Spigot server(s) for each sector (Paper 1.21.4 recommended). - Velocity proxy. - NATS (cluster if production). - Redis (prefer Redis >= 6; use replication in production). - Networking: open required ports (NATS, Redis, Velocity, Spigot). Ports (defaults in examples) - NATS: 4222 - Redis: 6379 - Velocity: your proxy port (e.g., 25577) - Spigot servers: assign unique ports per sector High-level install order (strict) 1. Start Common Service (must be first). 2. Start Velocity proxy and ensure it connects to Common. 3. Start Spigot/Paper sectors (they register to Common). Detailed steps 1) Common Service - Place `EndSectors-application.jar` on a stable host. - Create `config.json` next to the jar (see [Config Examples](Config-Examples.md#common-config)). - Run: - java -jar EndSectors-application.jar - Production: run as systemd service. Example unit: ``` [Unit] Description=EndSectors Common Service After=network.target [Service] User=endsectors WorkingDirectory=/opt/endsectors ExecStart=/usr/bin/java -jar /opt/endsectors/EndSectors-application.jar Restart=on-failure LimitNOFILE=4096 [Install] WantedBy=multi-user.target ``` 2) Velocity proxy - Put `EndSectors-proxy.jar` into `velocity/plugins/`. - Add server entries to `velocity.toml` for all sectors (names must follow Name Trinity, see [Configuration](Configuration.md#name-trinity)). - Configure `plugins/EndSectorsProxy/config.json`. - Start Velocity and watch logs for registration. 3) Spigot / Paper sectors - Put `EndSectors-paper.jar` (and optionally `EndSectors-tools.jar`) into each server's `plugins/`. - Copy the identical `world` folder to each sector server. - Configure `plugins/EndSectors/config.json` (ensure `currentSector` matches the server name). - Start the servers and ensure they connect to Common. Local development with Docker - You can run NATS and Redis locally with Docker: ``` docker run -d --name nats -p 4222:4222 nats:2.9.20 docker run -d --name redis -p 6379:6379 redis:7 ``` - Start Common on your machine with a config pointing to the above ports, then local Velocity and Paper instances for testing. Security & networking - Use TLS and auth for NATS in production. - Protect Redis with password and IP binding or use private network. - Use VPN or private subnets between services (do not expose Redis/NATS publicly). - Rotate credentials and minimize access scope. Monitoring & Logging - Expose metrics from Common and sectors (JMX or Prometheus exporter). - Aggregate logs (Grafana Loki, ELK) and monitor: - NATS latency & subjects - Redis memory & persistence - JVM GC and CPU usage - Sector TPS and player counts Next: See [Configuration](Configuration.md) for full configuration semantics and the strict Name Trinity rule.