How to Build, Run, and Deploy Arthas Tunnel Server for Real‑Time Java Diagnostics
This guide explains how to set up the open‑source Arthas Tunnel Server—covering its core features, Maven build steps, IDE and command‑line startup, Docker and Helm deployment options, and integration into Spring Boot applications using the eden‑architect framework.
Arthas Tunnel Server Overview
Arthas is an open‑source online diagnostic tool from Alibaba that provides a Dashboard, Thread view, Stack inspection, and Watch performance monitoring. The Arthas Tunnel Server adds automatic service discovery (retrieving application IPs and ports) and permission control based on Spring Security.
Key Features
Service discovery: automatically obtains the list of connected applications with their IPs and ports, eliminating the need to manually input AgentId.
Permission control: login management implemented with Spring Security and optional dynamic account binding via Nacos.
Configuration (YAML)
arthas:
tunnel:
users:
- name: admin
password: 123456
roles: '*'
- name: user
password: 123456
roles: []
- name: eden-gateway
# specific service authorizationBuild Process
Clone the repository and, from the project root, run: mvn package -T 4C This compiles the entire project using Maven.
Running from IDE (no external dependencies)
Execute mvn install (add -DskipTests to skip tests if desired).
Enter the tunnel-server directory and run mvn spring-boot:run or start the ArthasTunnelApplication class. A successful start shows the Spring Boot startup screen.
Enter the web-ui directory and run yarn run dev:tunnel (or yarn run dev:ui). The console prints http://localhost:8000, which can be opened in a browser.
Docker Image
The project is published on Docker Hub. Launch it with:
docker run -p 8080:8080 --name=arthas-tunnel-server -d shiyindaxiaojie/arthas-tunnel-serverOther Deployment Options
FatJar: mvn clean package creates a single JAR. Run it with java -Dserver.port=8080 -jar target/arthas-tunnel-server.jar.
Docker build: Use the layered Spring Boot image:
docker build -f Dockerfile-Tunnel -t arthas-tunnel-server:{tag} .Helm: Install with helm install arthas-tunnel-server ./helm and uninstall with helm uninstall arthas-tunnel-server.
Integration into Applications
The eden-architect framework simplifies Arthas integration. Add the following Maven dependency:
<dependency>
<groupId>io.github.shiyindaxiaojie</groupId>
<artifactId>eden-arthas-spring-boot-starter</artifactId>
</dependency>Enable and configure Arthas in application.yml:
spring:
arthas:
enabled: false # default off, enable as needed
agent-id: ${spring.application.name}@${random.value}
tunnel-server: ws://localhost:7777/ws
session-timeout: 1800
telnet-port: 0 # random port
http-port: 0 # random portExample Projects
Domain‑driven COLA architecture example: eden-demo-cola Layered architecture example:
eden-demo-layerOpen‑Source Repositories
GitHub: https://github.com/shiyindaxiaojie/arthas
Docker Hub: https://hub.docker.com/repository/docker/shiyindaxiaojie/arthas-tunnel-server
eden‑architect: https://github.com/shiyindaxiaojie/eden-architect
eden‑demo‑cola: https://github.com/shiyindaxiaojie/eden-demo-cola
eden‑demo‑layer: https://github.com/shiyindaxiaojie/eden-demo-layer
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
