Skip to main content

FreeBSD

Build Cleanuparr from source on FreeBSD systems with full dependency management and native compilation.

💡Note

The preferred method of installation method is using Docker.

Install Dependencies

Install the required packages and set up the development environment:

# Install basic dependencies
pkg install -y git icu libinotify libunwind wget node npm

Set up .NET SDK

Download and configure the .NET SDK for FreeBSD:

# Navigate to home directory
cd ~

# Set up variables for cleaner commands
DOTNET_VERSION="v9.0.104-amd64-freebsd-14"
DOTNET_BASE_URL="https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download"

# Download .NET SDK
wget -q "${DOTNET_BASE_URL}/${DOTNET_VERSION}/dotnet-sdk-9.0.104-freebsd-x64.tar.gz"

# Set up .NET environment
export DOTNET_ROOT=$(pwd)/.dotnet
mkdir -p "$DOTNET_ROOT"
tar zxf dotnet-sdk-9.0.104-freebsd-x64.tar.gz -C "$DOTNET_ROOT"
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

Install Angular CLI

Install Angular CLI globally for frontend build:

npm install -g @angular/cli

Download NuGet Dependencies

Download required NuGet packages for FreeBSD:

# Create NuGet directory
mkdir -p /tmp/nuget

# Set up variables for package URLs
NUGET_BASE_URL="${DOTNET_BASE_URL}/${DOTNET_VERSION}"
RUNTIME_VERSION="9.0.3"

# Download required packages
wget -q -P /tmp/nuget/ \
"${NUGET_BASE_URL}/Microsoft.AspNetCore.App.Runtime.freebsd-x64.${RUNTIME_VERSION}.nupkg"

wget -q -P /tmp/nuget/ \
"${NUGET_BASE_URL}/Microsoft.NETCore.App.Host.freebsd-x64.${RUNTIME_VERSION}.nupkg"

wget -q -P /tmp/nuget/ \
"${NUGET_BASE_URL}/Microsoft.NETCore.App.Runtime.freebsd-x64.${RUNTIME_VERSION}.nupkg"

Configure NuGet Sources

Add NuGet package sources:

# Add local NuGet source
dotnet nuget add source /tmp/nuget --name tmp

# Add GitHub NuGet source
# Note: Generate a PAT at https://github.com/settings/tokens
dotnet nuget add source \
--username <YOUR_USERNAME> \
--password <YOUR_PERSONAL_ACCESS_TOKEN> \
--store-password-in-clear-text \
--name Cleanuparr \
https://nuget.pkg.github.com/Cleanuparr/index.json

Important: Replace <YOUR_USERNAME> and <YOUR_PERSONAL_ACCESS_TOKEN> with your actual GitHub credentials.

Clone and Build Frontend

Clone the repository and build the frontend:

# Clone the project
git clone https://github.com/Cleanuparr/Cleanuparr.git
cd Cleanuparr

# Build the frontend
cd code/frontend
npm ci
npm run build
cd ../..

Build Backend Application

Copy frontend assets and build the backend:

# Copy frontend build to backend
mkdir -p code/backend/Cleanuparr.Api/wwwroot
cp -r code/frontend/dist/ui/browser/* \
code/backend/Cleanuparr.Api/wwwroot/

# Build and publish the backend
dotnet publish code/backend/Cleanuparr.Api/Cleanuparr.Api.csproj \
-c Release \
--self-contained \
-o artifacts \
/p:PublishSingleFile=true

# Move to final destination
mv artifacts/Cleanuparr /example/directory/

Run the Application

Make the binary executable and start Cleanuparr:

cd /example/directory
chmod +x Cleanuparr
./Cleanuparr

The application will start and be available at http://localhost:11011 by default.