README.md

May 10, 2026 · View on GitHub

license CI

Docker image of Hugo extended version

Project Archived

The official Hugo Docker image is now available, so this repository and its Docker images have completed their role. Thank you for using this project.

Debian Based Docker Image for Hugo (Hugo extended and Hugo Modules)

DockerHub Badge

Docker images on GitHub Packages ghcr.io/peaceiris/hugo are also available.

Getting Started

(1) Select Your Image

Image NameBase ImageCOMPRESSED SIZENotes
peaceiris/hugo:v0.x.xdebian:bullseye-slim72.64 MBSlim image
peaceiris/hugo:v0.x.x-modgolang:1.20-bullseye315.19 MBHugo Modules feature is available
peaceiris/hugo:v0.x.x-fullgolang:1.20-bullseye378.96 MBHugo Modules and Node.js are available

Note

  • peaceiris/hugo = ghcr.io/peaceiris/hugo
  • Hugo Modules: hugo mod
  • Node.js: node and npm

(2) Create Your docker-compose.yml

Create your docker-compose.yml like the following.

version: '3'

services:
  hugo:
    container_name: hugo
    image: peaceiris/hugo:v0.x.x            # Minimum image
    # image: peaceiris/hugo:v0.x.x-mod      # Hugo Modules
    # image: peaceiris/hugo:v0.x.x-full     # Hugo Modules and Node.js
    # image: ghcr.io/peaceiris/hugo:v0.x.x  # Docker images on GitHub Packages
    ports:
      - 1313:1313
    volumes:
      - ${PWD}:/src
    command:
      - server
      - --bind=0.0.0.0
      - --buildDrafts

(3) Start Your Container

# Run "hugo server"
docker-compose up

# Build site
docker-compose run --rm hugo ""
# Build site with flags
docker-compose run --rm hugo --gc --minify --cleanDestinationDir

# Run a command of Hugo
docker-compose run --rm hugo env

GitHub Actions for Hugo

The Hugo Setup GitHub Action is recommended.

License

Maintainer