Using Docker to Build a Lightweight File Sharing System with User Authentication Based on go-file
This article was last updated 287 days ago. The information within may have evolved or changed; if anything is outdated or broken, please feel free to leave a message in the comments section.
Article Abstract
Addressing the limitations of existing tools in daily file sharing scenarios, this article deploys the go-file system with user authentication support via Docker, solving the problem of lacking authentication mechanisms during public sharing. This solution adopts a containerized deployment method, combined with a reverse proxy to achieve public network access. By configuring user permissions and upload policies, it realizes multi-scenario sharing functions for text, videos, and images, while supporting online preview and custom folder management. Practice has verified the advantages of go-file in balancing privacy and ease of use, but its current version still has room for improvement, such as the lack of file management functions and sharing passwords, providing a direction for subsequent functional expansion.
Qwen3-14B · 2026-06-18

Preface

Regarding apps that can share files, I have introduced several before. The complex one is minio on a private COS platform (I mainly use it to provide downloads for large files, after all, minio's permanent file links need to be generated manually, which is a bit low-tech and inefficient; for specific configuration steps, see:Docker Series: Building a Private COS Platform Based on MinIO), and the lightweight one is pingvin-share (I mainly use it to store small files that need to be shared on my blog; for specific configuration steps, see:Docker Series: Using Docker to Deploy a Lightweight File Sharing Platform Based on pingvin-share), while for sending text and small files to friends daily, I use the burn-after-reading service provided by cryptgeon (for specific configuration steps, see:Docker Series: Using Docker to Build Your Own Burn-After-Reading Application Based on cryptgeon), and to be honest, it is basically enough to handle various daily scenarios.

However, the fly in the ointment is that when sending text or files to friends, using burn-after-reading always feels a bit sneaky, and I'm a bit afraid of being misunderstood by internet monitors that I'm doing something bad... Moreover, burn-after-reading apps basically don't require registration, which makes me afraid to use them openly (after all, the hostname in the link will expose my website), fearing that improper use might lead to me being investigated by the authorities~~~ (one needs to be cautious living in China). While pingvin-share supports registration, it essentially shares a folder with a fixed link. Although you can create a new link to share an individual file each time, the operation is slightly complicated and feels like using a sledgehammer to crack a nut, so I personally think it's best used on a blog.

So, is there an app that can be used openly to share files with friends, users, or others in daily life? I accidentally discovered one today, and that is go-file.

This article introduces go-file, a lightweight file sharing app that supports user authentication.

Deploying go-file

Creating the directory on the host machine that needs to be mounted inside the container

mkdir -p /docker/go-file/data

This directory is also used to store videos, files, images, etc., that need to be shared, so try to choose a good storage location according to your needs.

Setting up go-file

The command to set up go-file in docker run format is as follows:

docker run --name go-file -d --restart=always \
   -p 3000:3000 \ #映射宿主机上的3000端口到容器内部的3000端口,请根据实际环境修改
   -e TZ=Asia/Shanghai \ #设定容器时区
   -v /docker/go-file/data:/data \ #设定宿主机上需要挂载到容器内部的目录
   justsong/go-file

Publishing go-file to the public network using an appropriate method (optional)

Unless it is only used in a local area network, go-file definitely needs to be published to the public network. You need to choose the most suitable publishing method based on your actual environment and the reverse proxy you use. You can refer to several of my previous articles:
1、Docker Series: Building Your Own Reverse Proxy Based on NPM Using Docker
2、Linux Panel Series: Configuring Reverse Proxy and Publishing Using Non-443 Ports
3、Home Data Center Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad
4、Home Data Center Series: Getting Cloudflare for Free via Home Broadband Without Public IP to Achieve Fast Website Building (Universal)

Among them, the 1st and 2nd methods are suitable for environments with a public IP but without a legal 443 port (home broadband, non-filed cloud hosts), where non-standard ports need to be added after the URL (if using Cloudflare to build a website, no port needs to be added, but you need to customize the origin server port, which you can refer to:Home Data Center Series: Solving the Problem of Having a Public IP but No Legal 80 or 443 Ports for Website Building via Cloudflare's Origin Rules). The 3rd method is suitable for cloud hosts with ICP filing, and the 4th method is suitable for all environments (including environments without a public IP), which is also my recommended method (regardless of whether your environment has a public IP, because this method does not require running HTTPS traffic directly on the public network).

Assuming the access method for go-file after publishing ishttps://example.com

Accessing and configuring go-file

Usehttps://example.comAccess go-file (use http://host_ip:3000 for LAN access), the interface is as shown below:

image.png

For the first access, directly click "Login" in the red box in the upper right corner of the image above. On the user login interface, use the default username "admin" and default password "123456", then click "Submit":
image.png

After logging in, click "System Management" under the "admin" menu in the red box in the upper right corner:
image.png

Then modify the default administrator password (Note: changing the display name is not changing the account username), and then click "Submit":
image.png

The "Account Management" interface in the image above can also add "Regular Users" and "Administrator Users":
image.png

As well as "Manage Users":
image.png

In "System Settings", you can set the minimum permissions required for uploading and downloading respectively:
image.png

If you only use it for yourself, you can select Administrator for both "File Upload" and "Image Upload". Since I considered that friends might also use it, I selected "Regular User" as the minimum permission for uploading, as shown below:
image.png

Using go-file to share files

Sharing text files

Why do we need to talk about text files separately? Because this involves another application method: direct calling in the terminal.

For example, if you want to paste a piece of code into the server but are worried about various character formatting issues, you can directly upload the txt text file to go-file, and then use wget https://example.com/xxxxxxxx.txt -O file_name to directly download the text file locally and rename it; or if you have newly installed a server without a graphical interface, with no sshd service enabled, and no available editor to edit the sources.list file, and installing an editor using the default source is too slow, you can use curl https://example.com/xxxxxxxx.txt > /etc/apt/sources.list 或 wget https://example.com/xxxxxxxx.txt -O /etc/apt/sources.list to update the apt source, and then use apt update to update, or other similar scenarios. To be honest, minio can also do this, but the steps are relatively tedious and not as convenient as go-file.

Actually, speaking of this function, pasteme used to be the most convenient, but it stopped working after being shut down by authorities.

Sharing text is very simple, directly click "Upload" in the red box in the upper right corner:

image.png

There are two ways here: one is to directly copy the text to "Description", and then directly click upload, which will be automatically generated; you can also use the selection in the red box below to choose a local text file and then click upload:
image.png

After uploading, directly click the copy button in the red box on the right to get the file address:
image.png

After obtaining the file address, you can then operate through the several methods described above.

Sharing video files

Actually, the upload steps are the same. It's just that after uploading a video file, in addition to being able to share it using the sharing link, you can also play it online directly through the video menu:

image.png

Of course, this is actually played directly by the browser, so it requires formats supported by the browser (or installing a player).

Simple image hosting function

Under the image hosting menu, you can directly copy and paste or drag and drop to upload images:

image.png

Why call it a simple image hosting service? Look at the red box on the right, there are only 2 formats, one is http(s) or markdown:
image.png

Just in terms of the provided image links, compared to chevereto, it looks exceptionally simple:
image.png

image.png

Not to mention that chevereto has other features~. However, although simple, it also provides a plugin to work with picgo:
image.png

Overall, it can only be said to be usable, so everyone can choose according to their situation.

Online preview

If you upload files directly on the homepage, you can preview them online:

image.png

Why do I say on the homepage? Because by default go-file only has one image folder, which is used to store images uploaded under the image hosting menu, while other directly uploaded files are in folders automatically generated by the system named "Year-Month". The files under this automatically generated folder can be seen directly on the homepage, and can be: deleted, shared via QR code, link address copied, previewed online, and downloaded directly, as shown in the 5 icons at the bottom right of the image above.

Uploading files in folders you created

If you are in the host system/docker/go-file/data/uploadcreate other folders under the directory, for example, I created 3 folders: file, text, and video according to my habits, then selecting the "file" menu of go-file will show the new directory:

image.png

The files in the blue box at the bottom of the image above are automatically generated by the system, and the files in the red box are created by me directly on the host machine. Files uploaded in folders created by yourself will not appear on the homepage, so they cannot be deleted directly on the page, QR codes generated, or previewed online. You can only enter the folder to download and copy the share link:

image.png

If you want the uploaded files not to be displayed on the homepage, you can use this method.

Summary

Overall, go-file makes up for my small shortcoming when sharing files with others. At the same time, I am very satisfied with the support for user authentication. Finally, there is a tool that can be openly used to share with others. If you upload files in a self-created directory, they cannot be seen on the homepage, and privacy is also guaranteed. At the same time, I also connected the application to Cloudflare through a custom hostname for traffic scrubbing, so I am not afraid of attacks, perfect.

However, there are also some small regrets, such as no file management function at all. Except for files uploaded on the homepage which can be deleted directly on the page, files uploaded in folders created by yourself can only be deleted in the host machine. At the same time, it does not support sharing with passwords, nor does it support reading times and time control... At least, there should be an option to control whether the homepage displays visitor files, which is indeed a bit annoying. Even if I upload files on the homepage, I don't want everyone to access them. Maybe I just want to share them via links? In this regard, Peertube's video sharing is quite good:

image.png

I hope go-file can add these features in the future.

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Blog Knowledge Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews