Skip to main content

Installation

Security Warning

There is no built-in authentication. Never expose the server directly to the public internet. Always run it on a private network or behind a reverse proxy with proper authentication.

Prerequisites

Building from Source

Docker

Option 1: Build from Source

git clone https://github.com/egeozcan/mahresources.git
cd mahresources
npm install
npm run build

npm run build compiles Tailwind CSS, bundles JavaScript with Vite, and builds the Go binary with json1 and fts5 build tags.

Option 2: Docker

No pre-built image is published. Build it locally from the repository:

Dockerfile Go version

The Dockerfile currently uses golang:1.21-alpine, but the module requires Go 1.22+ (toolchain 1.24). You may need to update line 11 of the Dockerfile to golang:1.24-alpine before building.

git clone https://github.com/egeozcan/mahresources.git
cd mahresources
docker build -t mahresources .

# Run in ephemeral mode (data lost on exit)
docker run -p 8181:8181 mahresources -ephemeral

# Run with persistent storage
docker run -p 8181:8181 \
-v $(pwd)/data:/app/data \
-v $(pwd)/files:/app/files \
mahresources

The persistent storage example stores the database as data/test.db (the Dockerfile default). See the Docker deployment guide for compose files, custom database names, and production setup.

note

The default Docker image disables full-text search (SKIP_FTS=1). To enable search, add -e SKIP_FTS=0 to your docker run command.

Optional Dependencies

FFmpeg (Video Thumbnails)

Install FFmpeg to generate thumbnails for video files.

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt install ffmpeg

# Windows (via Chocolatey)
choco install ffmpeg

Then specify the path (if not in PATH):

./mahresources -ffmpeg-path=/usr/bin/ffmpeg

LibreOffice (Document Thumbnails)

Install LibreOffice to generate thumbnails for Office documents (Word, Excel, PowerPoint, etc.).

# macOS
brew install --cask libreoffice

# Ubuntu/Debian
sudo apt install libreoffice

# Windows
# Download from https://www.libreoffice.org/download/

soffice or libreoffice in your PATH is auto-detected. To specify a custom path:

./mahresources -libreoffice-path=/usr/bin/libreoffice

ImageMagick (HEIC/AVIF Thumbnails)

Install ImageMagick to generate thumbnails for HEIC and AVIF images. Mahresources falls back to ImageMagick's convert command when the standard Go image decoders cannot handle a format.

# macOS
brew install imagemagick

# Ubuntu/Debian
sudo apt install imagemagick

# Windows (via Chocolatey)
choco install imagemagick

Either the magick command (ImageMagick 7) or the convert command (ImageMagick 6) must be available in your PATH. No additional configuration flag is needed.

Next Steps

Next: Quick Start to run the application for the first time.