Skip to content

Deploying Sigal

Introduction

Sigal is a static gallery generator written in Python that creates beautiful, responsive photo galleries from your image collection. Unlike dynamic gallery applications, Sigal generates static HTML files that can be served by any web server, resulting in fast, secure, and easy-to-host galleries.

Sigal takes a folder of images and generates a complete gallery with thumbnails, navigation, and optional features like EXIF data display, image maps, and video support. The generated output is pure HTML, CSS, and JavaScript with no server-side processing required.

Key highlights of Sigal:

  • Static Output: Generates pure HTML/CSS/JS galleries
  • Automatic Thumbnails: Creates optimized thumbnails at configurable sizes
  • EXIF Support: Extracts and displays camera metadata
  • Video Support: Handles video files in galleries
  • Multiple Themes: Customizable themes and templates
  • Responsive Design: Galleries work on all screen sizes
  • ZIP Downloads: Optional album download functionality
  • Markdown Descriptions: Add descriptions with Markdown
  • Image Optimization: Resize and compress images automatically
  • GPS Mapping: Display photo locations on maps
  • Fast Generation: Incremental builds for large galleries
  • Open Source: MIT licensed

This guide walks through deploying Sigal on Klutch.sh using Docker, configuring gallery generation, and hosting your static photo galleries.

Why Deploy Sigal on Klutch.sh

Deploying Sigal on Klutch.sh provides several advantages for photo galleries:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds your gallery server. Push to GitHub, and your galleries deploy automatically.

Persistent Storage: Attach persistent volumes for your source images and generated galleries. Your photos and galleries survive container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure photo sharing.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Static Hosting: The generated galleries are static files served efficiently with minimal resources.

Custom Domains: Assign a custom domain for a professional gallery experience.

Always-On Availability: Your galleries remain accessible 24/7.

Prerequisites

Before deploying Sigal on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Sigal configuration
  • Basic familiarity with Docker and Python
  • Photos you want to display in galleries
  • (Optional) A custom domain for your gallery

Understanding Sigal Architecture

Sigal operates as a static site generator:

Python Generator: Sigal processes source images and generates static HTML galleries.

Template System: Jinja2 templates define gallery layout and appearance.

Image Processing: PIL/Pillow handles thumbnail generation and image optimization.

Static Output: The generated gallery is pure HTML/CSS/JS with no runtime dependencies.

Web Server: Any static file server (nginx, Apache) can serve the generated files.

Preparing Your Repository

To deploy Sigal on Klutch.sh, create a GitHub repository with your configuration.

Repository Structure

sigal-deploy/
├── Dockerfile
├── sigal.conf.py
├── .dockerignore
└── README.md

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM python:3.11-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
libjpeg-dev \
libpng-dev \
ffmpeg \
nginx \
&& rm -rf /var/lib/apt/lists/*
# Install Sigal
RUN pip install sigal pillow
# Create directories
RUN mkdir -p /source /output /config
# Copy configuration
COPY sigal.conf.py /config/sigal.conf.py
# Copy nginx configuration
RUN echo 'server { \n\
listen 80; \n\
root /output; \n\
location / { \n\
try_files $uri $uri/ =404; \n\
} \n\
}' > /etc/nginx/sites-available/default
# Create entrypoint script
RUN echo '#!/bin/bash\n\
sigal build /source /output -c /config/sigal.conf.py\n\
nginx -g "daemon off;"' > /entrypoint.sh && \
chmod +x /entrypoint.sh
EXPOSE 80
CMD ["/entrypoint.sh"]

Creating the Configuration File

Create a sigal.conf.py file:

# Sigal configuration file
# Source and destination (can be overridden via command line)
source = '/source'
destination = '/output'
# Theme settings
theme = 'galleria'
# Image settings
img_size = (1920, 1080)
thumb_size = (280, 210)
thumb_fit = True
# JPEG quality (1-100)
jpg_options = {'quality': 85, 'optimize': True}
# Generate thumbnails for videos
make_thumbs = True
# Show EXIF data
show_exif = True
# Zip galleries for download
zip_gallery = True
# Title and description
title = 'My Photo Gallery'
description = 'A collection of my photographs'
# Links to original images
orig_link = True
# Image processing
autorotate_images = True
# Files to ignore
ignore_directories = ['.git', 'cache']
ignore_files = ['*.txt', '*.md', '.DS_Store']
# Locale
locale = 'en_US.utf8'
# Google Maps API key for location display (optional)
# google_maps_api_key = 'your-api-key'

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store

Deploying Sigal on Klutch.sh

Once your repository is prepared, follow these steps to deploy Sigal:

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile sigal.conf.py .dockerignore README.md
    git commit -m "Initial Sigal deployment configuration"
    git remote add origin https://github.com/yourusername/sigal-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “sigal” or “photo-gallery”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Sigal Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Attach Persistent Volumes

    Add volumes for your photos and generated galleries:

    Mount PathRecommended SizePurpose
    /source100+ GBSource photos (adjust based on collection)
    /output50 GBGenerated gallery files

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Build the container image with Sigal and nginx
    • Attach the persistent volumes
    • Start the container
    • Provision an HTTPS certificate

    Upload Your Photos

    After deployment, upload your photos to the /source volume. Organize them in folders to create albums:

    /source/
    ├── 2023-vacation/
    │ ├── photo1.jpg
    │ ├── photo2.jpg
    │ └── description.md
    ├── family-photos/
    │ └── ...
    └── index.md

    Regenerate Gallery

    Restart the container to regenerate the gallery with new photos.

    Access Your Gallery

    Once generation completes, access your gallery at https://your-app-name.klutch.sh.

Organizing Your Photos

Folder Structure

Create albums using directory structure:

/source/
├── 2024/
│ ├── january/
│ │ ├── event1/
│ │ └── event2/
│ └── february/
├── travel/
│ ├── paris/
│ └── tokyo/
└── index.md

Adding Descriptions

Create index.md files for album descriptions:

# Summer Vacation 2024
Photos from our trip to the beach.
- Location: California Coast
- Date: July 2024

Image Descriptions

Name files descriptively or add individual descriptions:

sunset-beach.jpg
sunset-beach.md # Contains description for this image

Configuration Options

Theme Selection

Available themes:

ThemeDescription
galleriaModern, responsive gallery with slideshow
colorboxLightbox-style image viewer
photoswipeTouch-friendly mobile gallery

Image Sizes

Configure image and thumbnail dimensions:

# Full-size images
img_size = (1920, 1080)
# Thumbnails
thumb_size = (280, 210)
thumb_fit = True # Crop to exact size

EXIF Display

Control metadata display:

show_exif = True
# Available EXIF fields: aperture, camera, date, exposure, flash,
# focal, gps, iso, lens, location, model, software, speed

Production Best Practices

Performance Optimization

  • Image Optimization: Original images are automatically optimized
  • Thumbnail Caching: Thumbnails are cached between builds
  • Lazy Loading: Modern themes support lazy loading

Storage Management

  • Source Organization: Keep source photos organized for easy management
  • Archive Originals: Keep original photos backed up elsewhere
  • Clean Builds: Periodically clean and rebuild if issues occur

Backup Strategy

  1. Source Photos: Back up /source directory with original photos
  2. Configuration: Keep sigal.conf.py in version control
  3. Generated Output: Can be regenerated from source

Troubleshooting Common Issues

Thumbnails Not Generating

Symptoms: Gallery shows broken thumbnail images.

Solutions:

  • Verify Pillow is installed correctly
  • Check file permissions on output directory
  • Ensure source images are valid JPEG/PNG files

Videos Not Playing

Symptoms: Video files don’t play in gallery.

Solutions:

  • Verify ffmpeg is installed
  • Check video format compatibility
  • Ensure video files aren’t too large

Slow Generation

Symptoms: Gallery takes very long to build.

Solutions:

  • Use incremental builds (default behavior)
  • Reduce image sizes in configuration
  • Process fewer images per album

Additional Resources

Conclusion

Deploying Sigal on Klutch.sh gives you a fast, secure photo gallery with automatic builds, persistent storage, and secure HTTPS access. The combination of Sigal’s static generation and Klutch.sh’s deployment simplicity means you can share your photos without complex infrastructure.

With automatic thumbnail generation, EXIF support, and responsive themes, Sigal creates professional-looking galleries from your photo collection. The static output means fast loading times and minimal server resources.

Whether you’re sharing vacation photos with family or showcasing your photography portfolio, Sigal on Klutch.sh provides the reliable foundation for beautiful, self-hosted photo galleries.