Deploying Gitit
Introduction
Gitit is a wiki program written in Haskell that uses Git (or Darcs, or Mercurial) as a backend for version control. Pages and uploaded files are stored in a repository and can be modified either through the wiki’s web interface or by using the version control system’s command-line tools.
Built on the powerful Pandoc library, Gitit supports multiple markup formats including Markdown, reStructuredText, LaTeX, and MediaWiki syntax. Every change is automatically committed to the repository, providing complete revision history and the ability to revert changes.
Key highlights of Gitit:
- Git Backend: Full version control for all wiki content
- Multiple Markup Formats: Markdown, RST, LaTeX, MediaWiki, and more
- Pandoc Integration: Powerful document conversion capabilities
- Math Support: Render LaTeX math equations
- File Uploads: Upload and manage files through the web interface
- Full-Text Search: Search across all wiki pages
- User Authentication: Optional user accounts and access control
- Categories: Organize pages with categories
- Page History: View and compare revisions
- Export Options: Export pages to various formats (PDF, EPUB, etc.)
- Open Source: Licensed under GPL
This guide walks through deploying Gitit on Klutch.sh using Docker, configuring the wiki, and managing content.
Why Deploy Gitit on Klutch.sh
Deploying Gitit on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Gitit. Push to GitHub, and your wiki deploys automatically.
Persistent Storage: Attach persistent volumes for your wiki repository. Content and history survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure wiki access.
GitHub Integration: Connect your configuration repository directly from GitHub for automatic updates.
Custom Domains: Assign a custom domain for your wiki.
Always-On Availability: Your wiki remains accessible 24/7.
Git Portability: Clone and backup your wiki using standard Git tools.
Prerequisites
Before deploying Gitit on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Gitit configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) A custom domain for your wiki
Understanding Gitit Architecture
Gitit uses a straightforward architecture:
Haskell Backend: The wiki server is written in Haskell using the Happstack web framework.
Git Repository: All wiki content is stored in a Git repository, providing version control.
Pandoc: Document conversion and rendering handled by the Pandoc library.
Static Files: Templates, CSS, and JavaScript for the web interface.
Configuration File: YAML or command-line configuration for server settings.
Preparing Your Repository
To deploy Gitit on Klutch.sh, create a GitHub repository containing your Dockerfile.
Repository Structure
gitit-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM hyzual/gitit:latest
# Set working directoryWORKDIR /data
# Create wiki directoriesRUN mkdir -p /data/wikidata /data/static /data/templates
# Expose the web interface portEXPOSE 5001
# Start GititCMD ["gitit", "-f", "gitit.conf"]Alternative Dockerfile with Configuration
For more customization:
FROM hyzual/gitit:latest
WORKDIR /data
# Create directoriesRUN mkdir -p /data/wikidata /data/static /data/templates
# Create default configurationRUN echo 'port: 5001' > /data/gitit.conf && \ echo 'wiki-title: My Wiki' >> /data/gitit.conf && \ echo 'repository-type: Git' >> /data/gitit.conf && \ echo 'repository-path: wikidata' >> /data/gitit.conf && \ echo 'require-authentication: modify' >> /data/gitit.conf && \ echo 'authentication-method: form' >> /data/gitit.conf
# Initialize Git repositoryRUN cd /data/wikidata && git init
EXPOSE 5001
CMD ["gitit", "-f", "/data/gitit.conf"]Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdREADME.mdLICENSE.gitignore*.log.DS_Store.env.env.localDeploying Gitit on Klutch.sh
Once your repository is prepared, follow these steps to deploy Gitit:
- Select HTTP as the traffic type
- Set the internal port to 5001 (Gitit’s default port)
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Gitit container
- Provision an HTTPS certificate
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial Gitit deployment configuration"git remote add origin https://github.com/yourusername/gitit-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “gitit” or “wiki”.
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 Gitit Dockerfile.
Configure HTTP Traffic
Gitit serves its web interface over HTTP. In the deployment settings:
Attach Persistent Volumes
Persistent storage preserves your wiki content:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 5 GB | Wiki repository, templates, and configuration |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access Gitit
Once deployment completes, access your Gitit wiki at https://your-app-name.klutch.sh. You’ll see the front page ready for editing.
Initial Configuration
Configuration Options
Create or modify gitit.conf:
# Basic settingsport: 5001wiki-title: My Wikirepository-type: Gitrepository-path: wikidata
# Authenticationrequire-authentication: modifyauthentication-method: form
# Access controlaccess-question: What is 2+2?access-question-answers: 4, four, Four
# Appearancedefault-page-type: markdownmath: mathjaxuse-cache: yes
# File uploadsmax-upload-size: 10Mmax-page-size: 1MAuthentication Modes
Configure access control:
| Mode | Description |
|---|---|
| none | No authentication required |
| modify | Authentication required for editing |
| read | Authentication required for reading |
Registration
Enable user registration:
use-recaptcha: norecaptcha-public-key:recaptcha-private-key:Creating Content
Creating Pages
Create a new page:
- Navigate to a non-existent page URL (e.g.,
/NewPage) - Click “Create this page”
- Enter content in Markdown
- Save to commit
Markdown Syntax
Gitit supports extended Markdown:
# Heading 1## Heading 2
**Bold** and *italic* text
- Bullet list- Another item
1. Numbered list2. Second item
[Link text](https://example.com)

`inline code`
code block indented
> Blockquote
| Table | Header ||-------|--------|| Cell | Cell |Math Equations
Insert LaTeX math:
Inline: $E = mc^2$
Display:$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$Internal Links
Link between wiki pages:
[Home](/)[Another Page](/AnotherPage)[Section](/Page#section)File Management
Uploading Files
- Navigate to Upload file in the tools menu
- Select a file
- Upload and get the path
- Reference in pages:

File Organization
Organize uploads:
/uploaded/├── images/│ ├── logo.png│ └── photo.jpg├── documents/│ └── report.pdf└── attachments/Categories
Adding Categories
Add categories to pages:
---categories: Documentation, Tutorials---
# Page Content
Your content here...Viewing Categories
- Browse
/categoriesfor all categories - Click a category to see all pages
Revision History
Viewing History
- Click History on any page
- View all revisions
- Compare versions
- Revert if needed
Reverting Changes
- View the history
- Select a previous version
- Create a new revision with old content
Exporting Content
Export Formats
Gitit supports multiple export formats via Pandoc:
| Format | URL suffix |
|---|---|
?format=pdf | |
| EPUB | ?format=epub |
| DocX | ?format=docx |
| ODT | ?format=odt |
| Plain Text | ?format=plain |
Backup via Git
Clone your entire wiki:
git clone your-server:/data/wikidata wiki-backupCustomization
Templates
Customize templates in /data/templates/:
page.st- Page layoutfooter.st- Footer contentsidebar.st- Sidebar content
CSS Styling
Add custom CSS in /data/static/css/custom.css:
body { font-family: Georgia, serif;}
.page { max-width: 800px; margin: 0 auto;}Production Best Practices
Security Recommendations
- Enable Authentication: Require login for modifications
- Access Questions: Add verification for registration
- HTTPS: Always use HTTPS (provided by Klutch.sh)
- Regular Backups: Clone repository regularly
Backup Strategy
Protect your wiki content:
- Git Clone: Clone repository for backup
- Scheduled Backups: Automate with cron
- Off-site Storage: Store backups remotely
Performance Tips
- Enable caching in configuration
- Optimize images before upload
- Use appropriate page sizes
Troubleshooting Common Issues
Pages Not Saving
Solutions:
- Check Git repository permissions
- Verify disk space
- Review Gitit logs
Formatting Issues
Solutions:
- Verify Markdown syntax
- Check Pandoc compatibility
- Review page metadata
Authentication Problems
Solutions:
- Check configuration file
- Verify user database
- Clear browser cookies
Additional Resources
- Gitit GitHub Repository
- Pandoc Documentation
- Gitit Docker Hub
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Gitit on Klutch.sh gives you a powerful, version-controlled wiki with automatic builds and secure HTTPS access. The combination of Gitit’s Git backend and Klutch.sh’s deployment simplicity means you can focus on content rather than infrastructure.
With support for multiple markup formats, math rendering, and complete revision history, Gitit provides everything you need for collaborative documentation. Whether you’re building a personal knowledge base or team documentation, Gitit on Klutch.sh delivers reliable wiki functionality with the power of Git version control.