Introduction
kkFileView is a Java-based file preview server. Normally, you can use the pre-built files to deploy. However, if you want to modify the source code or customize it to your needs, you may need to build it yourself.
This guide shows you how to deploy kkFileView in an Ubuntu Linux environment, with the interface already translated into English.
Step 1: Clone the English-Translated Version
In Windows Environment
Clone the source code and open it in Visual Studio:
Install Java 1.8 on window
Ensure you have Java 1.8 installed:
C:\Windows\system32> java -version
java version "1.8.0_202"
Inside the project folder, you'll find a mvnw.cmd
file. This is a Windows-specific build script that will download all required dependencies and package the project into a .jar
file for deployment.
Run the build command:
.\mvnw.cmd clean package
After a successful build, you will see a target
directory:
Step 2: Build kkFileView Docker Image
The best way to deploy kkFileView is via Docker.
Install Docker on Ubuntu
On your Ubuntu server (e.g., Ubuntu 22.04), install Docker. Verify installation:
docker --version
# Docker version 28.0.1, build 068a01e
Prepare Docker Folder
Create a directory to hold the Docker files:
mkdir -p /srv/kkfileview_docker
Upload the Docker files into that directory. The folder structure should look like this:
Upload the Built File
Upload the built file kkFileView-4.4.0-beta.tar.gz
into the target
folder:
Step 3: Build Docker Images
Build Base Image
Navigate to the base_image
folder and build the base Docker image:
cd /srv/kkfileview_docker/base_image/
docker build -t kkfileview:latest .
docker tag kkfileview:latest kkfileview_base:4.4.0
Check Docker images:
docker images
Expected output:
REPOSITORY TAG IMAGE ID CREATED SIZE
kkfileview latest 86f38e262e9e 35 minutes ago 992MB
kkfileview_base 4.4.0 86f38e262e9e 35 minutes ago 992MB
mysql 8.0.33 f6360852d654 20 months ago 565MB
Build kkFileView Server Image
Now build the server image:
cd /srv/kkfileview_docker/
docker build -t kkfileview:latest .
Verify again:
REPOSITORY TAG IMAGE ID CREATED SIZE
kkfileview latest 3686c4561a04 19 seconds ago 1.32GB
kkfileview_base 4.4.0 86f38e262e9e 41 minutes ago 992MB
mysql 8.0.33 f6360852d654 20 months ago 565MB
Step 4: Run the Docker Container
Create Persistent File Mount
Create a mount point to store previewed files:
mkdir -p /srv/kkfileview_files
Start the Container
docker run -d \
-p 8012:8012 \
-v /opt/kkFileView/files:/srv/kkFileView_files \
--name kkfileview \
kkfileview:latest
Check that the container is running:
docker ps
Example output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f4f04076cec6 kkfileview:latest "java -Dfile.encodin…" 4 seconds ago Up 3 seconds 0.0.0.0:8012->8012/tcp, [::]:8012->8012/tcp kkfileview
Step 5: Verify kkFileView Server
Test using curl:
curl http://localhost:8012
You should see HTML content returned
Now open your browser and go to:
http://<your-server-ip>:8012
Try uploading a file and clicking the Preview button:
Reply