Skip to content

A lightweight, secure, source-built Freenet (Hyphanet) Docker image with auto-bootstrapping.

License

Notifications You must be signed in to change notification settings

soren-work/freenet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freenet Docker Node (Source-Built & Optimized)

Build Status License Docker Image Size

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.

✨ Key Features

  • 🛡️ Source-Built Security: The JARs are compiled directly from the official hyphanet/fred repository. No opaque binary blobs.
  • 🚀 Zero-Config Bootstrapping: Automatically fetches the latest seednodes.fref from 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.ini optimized 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.

🚀 Quick Start

Option 1: Docker Compose (Recommended)

This is the most stable and configurable way to run the node.

  1. Create a docker-compose.yml file:
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
  1. Start the node:
docker compose up -d
  1. Monitor logs to see the connection progress:
docker compose logs -f

Option 2: Docker CLI

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

⚙️ Configuration

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.

Environment Variables

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.

Volumes

Path Description
/data Stores freenet.ini, master.keys, logs, the datastore, and seednodes.fref. Map this to a persistent volume.

🔒 Accessing the Web Interface (FProxy)

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:

  1. 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
  1. Open your web browser and navigate to: http://127.0.0.1:8888

🛠️ Build from Source

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 .

📝 License

This project is licensed under the MIT License. Freenet itself is free software distributed under the GNU General Public License (GPL).

💖 Support

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.

About

A lightweight, secure, source-built Freenet (Hyphanet) Docker image with auto-bootstrapping.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages