A lightweight, secure, and source-built Docker image for Freenet (Hyphanet).
This repository provides a Dockerfile that compiles Freenet (Fred) directly from the official source code using Gradle. It is specifically optimized for low-resource environments (e.g., 1GB RAM VPS) and solves the common bootstrapping issue by automatically provisioning seednodes.
- 🛡️ Source-Built Security: The JARs are compiled directly from the official
hyphanet/fredrepository. No opaque binary blobs. - 🚀 Zero-Config Bootstrapping: Automatically fetches the latest
seednodes.freffrom the official repository during the build. The node connects to the network immediately upon startup—no "0 seednodes" errors. - 📉 Low-Resource Optimized: Tuned JVM parameters (
-Xmx256m) and efficient build stages ensure stability on small VPS instances. - ⚙️ Auto-Configuration: A smart entrypoint script generates a
freenet.inioptimized for Docker if one doesn't exist. - 🐳 Multi-Stage Build: Keeps the final image small by separating the Gradle build environment from the runtime JRE.
- 🔄 Auto-Updates: GitHub Actions automatically check for upstream Freenet releases daily and rebuild the image if a new version is detected.
This is the most stable and configurable way to run the node.
- Create a
docker-compose.ymlfile:
services:
freenet:
image: ghcr.io/soren-work/freenet:latest
container_name: freenet
restart: unless-stopped
# Resource limits (Recommended for 1GB VPS)
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
ports:
- "28949:28949/udp" # Darknet
- "28950:28950/udp" # Opennet
- "127.0.0.1:8888:8888" # Web UI (Localhost only)
volumes:
- ./data:/data
environment:
- FREENET_MEM=256m
- FNP_PORT=28949
- OPENNET_PORT=28950
- Start the node:
docker compose up -d
- Monitor logs to see the connection progress:
docker compose logs -f
docker run -d \
--name freenet \
--restart unless-stopped \
-p 28949:28949/udp \
-p 28950:28950/udp \
-p 127.0.0.1:8888:8888 \
-e FREENET_MEM=256m \
-v $(pwd)/data:/data \
ghcr.io/soren-work/freenet:latest
You can configure the node using environment variables. The entrypoint script will use these to generate the freenet.ini config file only on the first run.
| Variable | Default | Description |
|---|---|---|
FNP_PORT |
28949 |
UDP port for Darknet (Friend-to-Friend) connections. |
OPENNET_PORT |
28950 |
UDP port for Opennet (Public) connections. |
FREENET_MEM |
256m |
Max heap memory for the JVM (-Xmx). Increase this if you have more RAM. |
FREENET_STORE_SIZE |
1G |
Size of the datastore on disk. |
FREENET_BANDWIDTH |
2048k |
Upload bandwidth limit. |
FREENET_BANDWIDTH_DOWN |
4096k |
Download bandwidth limit. |
| Path | Description |
|---|---|
/data |
Stores freenet.ini, master.keys, logs, the datastore, and seednodes.fref. Map this to a persistent volume. |
For security reasons, the Web Interface (FProxy) is bound to 127.0.0.1 by default in the docker-compose.yml example. This prevents scanners from finding your node on the public internet.
To access the interface on a remote VPS, use an SSH Tunnel:
- Run this command on your local machine:
# Replace user@your-vps-ip with your actual server details
ssh -L 8888:127.0.0.1:8888 user@your-vps-ip
- Open your web browser and navigate to: http://127.0.0.1:8888
If you want to build the image locally instead of pulling from GHCR:
git clone [https://github.com/soren-work/freenet.git](https://github.com/soren-work/freenet.git)
cd freenet
# Build the image (args are optional, defaults to master branch)
docker build --build-arg FREENET_TAG=master -t my-freenet-node .
This project is licensed under the MIT License. Freenet itself is free software distributed under the GNU General Public License (GPL).
If you find this project helpful, please consider supporting its development.
Disclaimer: This is an unofficial, community-maintained build. I am not affiliated with the Freenet Project. Use at your own risk.