JDK Installation
Prerequisites
The Docker commands below use a Linux server as an example. Before starting, confirm the following:
- Docker is installed and running, and the current account has permission to run
dockercommands. - The backend has been packaged as
fastbee-admin.jarand uploaded to/var/data/java/. - Port
8080is not occupied by another service, and the firewall or security group allows access as required by the deployment. - The upload and log directories have been created:
mkdir -p /var/data/java/uploadPath /var/data/java/logs
test -f /var/data/java/fastbee-admin.jarInstalling in the Operating System
Native JDK installation differs between Windows and Linux. This page does not repeat general installation tutorials and instead focuses on Docker. The container uses the openjdk:8-jre image, so no separate JDK installation is required on the host.
Docker Installation and Backend Deployment
提示
Before running the container, create a bridge network if one does not already exist for communication between containers: docker network create -d bridge fastbee-bridge
- Confirm that the packaged
fastbee-admin.jarhas been uploaded to/var/data/java/. - Run the following command:
docker run \
--name java \
--publish 8080:8080 \
--volume /var/data/java/fastbee-admin.jar:/server.jar \
--volume /var/data/java/uploadPath:/uploadPath \
--volume /var/data/java/logs:/logs \
--volume /etc/localtime:/etc/localtime \
--env "TZ=Asia/Shanghai" \
--network fastbee-bridge \
--restart unless-stopped \
--detach \
openjdk:8-jre \
java -jar /server.jar- Command parameter descriptions:
--name # Container name
--publish # Container port mapping
--volume # Mounted volume path, persisting container files on the server
--env # Set container environment variables
--network # Network mode: container/none/bridge/host
--restart # Restart policy: no/on-failure/always/unless-stopped
--detach # Run in the backgroundVerifying the Deployment
- Check the container status and port mapping:
docker ps --filter name=java
docker port java 8080- Inspect the startup logs and confirm that the application has started without recurring exceptions:
docker logs -n 200 java- Access the backend or frontend entry point for your deployment architecture, then verify basic functions such as login and the device list. If the container repeatedly exits, preserve and inspect the logs before recreating it.
FAQ
What should I do if the container exits immediately after startup?
Run docker logs -n 200 java to inspect the exception. Confirm that /var/data/java/fastbee-admin.jar is a valid file rather than a directory, the mount paths match the startup command, and dependencies such as the database and Redis are reachable with the current application configuration.
What should I do if the container is running but port 8080 is unreachable?
Run docker port java 8080 to verify the port mapping, check the server firewall and cloud security group, and use the application logs to confirm that the backend is listening on port 8080 inside the container.
What should I do if uploaded files or logs cannot be written?
Check that /var/data/java/uploadPath and /var/data/java/logs on the host match the container mount paths, and that the user running the container has write permission. Adjust directory ownership or permissions for the actual account instead of using chmod 777 as a long-term solution.


