Deploying Publify
Introduction
Publify is a self-hosted, open-source blogging platform built with Ruby on Rails. It has been actively developed since 2004, making it one of the oldest and most mature Rails-based blogging engines. Publify offers a complete blogging solution with features like multiple authors, themes, SEO optimization, and social media integration.
With a clean, intuitive admin interface and a responsive default theme, Publify makes it easy to start blogging while providing the flexibility for customization. It supports rich content editing, media management, and various content types beyond traditional blog posts.
Key highlights of Publify:
- Rich Editor: Full-featured content editor with media embedding
- Multiple Authors: Support for multiple writers with different roles
- Themes: Customizable themes for your blog’s appearance
- SEO Friendly: Built-in SEO optimization and meta tag management
- Comments: Native commenting system with spam protection
- Social Integration: Share content to social networks
- RSS/Atom Feeds: Automatic feed generation for subscribers
- Markdown Support: Write in Markdown for easy formatting
- Media Library: Upload and manage images and files
- Open Source: Licensed under MIT
This guide walks through deploying Publify on Klutch.sh using Docker.
Why Deploy Publify on Klutch.sh
Deploying Publify on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Publify without complex configuration.
Persistent Storage: Attach persistent volumes for database, uploads, and media files.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure access.
GitHub Integration: Connect your repository directly from GitHub for automatic deployments.
Custom Domains: Assign a custom domain for your professional blog.
Always-On Availability: Your blog remains accessible 24/7.
Prerequisites
Before deploying Publify on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Publify configuration
- A PostgreSQL or MySQL database
- Basic familiarity with Docker and containerization concepts
- (Optional) A custom domain for your blog
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for Publify deployment.
Repository Structure
publify-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM ruby:3.1
# Install dependenciesRUN apt-get update && apt-get install -y \ nodejs \ npm \ libpq-dev \ imagemagick \ && rm -rf /var/lib/apt/lists/*
# Install yarnRUN npm install -g yarn
WORKDIR /app
# Clone PublifyRUN git clone https://github.com/publify/publify.git . && \ git checkout stable
# Install Ruby dependenciesRUN bundle config set --local without 'development test' && \ bundle install
# Install JavaScript dependenciesRUN yarn install
# Precompile assetsENV RAILS_ENV=productionENV SECRET_KEY_BASE=placeholder_for_precompileRUN bundle exec rails assets:precompile
# Create required directoriesRUN mkdir -p tmp/pids tmp/cache log public/uploads
# Remove placeholderENV SECRET_KEY_BASE=
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000"]Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Storetmp/log/Deploying Publify on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Publify container
- Provision an HTTPS certificate
Generate Secret Keys
Generate secret keys for Rails:
# Secret key baseruby -rsecurerandom -e "puts SecureRandom.hex(64)"Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignoregit commit -m "Initial Publify deployment configuration"git remote add origin https://github.com/yourusername/publify-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 “publify” or “my-blog”.
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 Publify Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
RAILS_ENV | production |
SECRET_KEY_BASE | Your generated secret key |
DATABASE_URL | postgresql://user:pass@host/publify |
RAILS_SERVE_STATIC_FILES | true |
RAILS_LOG_TO_STDOUT | true |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/public/uploads | 20 GB | Uploaded media files |
/app/log | 1 GB | Application logs |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Run Database Setup
After deployment, initialize the database:
bundle exec rails db:setupAccess Publify
Once deployment completes, access your Publify blog at https://your-app-name.klutch.sh. Complete the setup wizard to configure your blog.
Initial Configuration
Setup Wizard
The first-time setup wizard guides you through:
- Blog title and tagline
- Admin account creation
- Basic settings configuration
Admin Interface
Access the admin panel at /admin:
- Manage articles and pages
- Configure blog settings
- Customize appearance
- Manage users and authors
Writing Content
Creating Articles
- Go to Admin > Articles > New
- Enter title and content
- Use Markdown or visual editor
- Add categories and tags
- Set publication date
- Publish or save as draft
Content Types
| Type | Description |
|---|---|
| Articles | Standard blog posts |
| Pages | Static content pages |
| Notes | Short-form content (like tweets) |
Media Management
Upload and manage media:
- Go to Admin > Media
- Upload images and files
- Insert into articles via editor
Customization
Themes
Change your blog’s appearance:
- Go to Admin > Design > Themes
- Browse available themes
- Activate desired theme
- Customize with Sidebar components
Sidebar Components
Add functionality to your sidebar:
- Recent articles
- Categories
- Archives
- Search
- Custom HTML
User Management
User Roles
| Role | Permissions |
|---|---|
| Admin | Full access to all features |
| Publisher | Create and publish content |
| Contributor | Create content (no publish) |
Creating Users
- Go to Admin > Users
- Click “Add User”
- Set username and password
- Assign role
- Save user
SEO Configuration
Meta Tags
Configure SEO settings:
- Go to Admin > Settings > SEO
- Set default meta description
- Configure canonical URLs
- Enable sitemap generation
Per-Article SEO
Each article can have:
- Custom meta description
- Focus keywords
- Custom URL slug
Troubleshooting Common Issues
Assets Not Loading
Solutions:
- Verify
RAILS_SERVE_STATIC_FILESis true - Recompile assets
- Check file permissions
Database Errors
Solutions:
- Verify DATABASE_URL is correct
- Check database connectivity
- Run pending migrations
Image Uploads Failing
Solutions:
- Check upload directory permissions
- Verify ImageMagick is installed
- Check file size limits
Additional Resources
- Publify Official Website
- Publify GitHub Repository
- Publify Wiki
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Publify on Klutch.sh gives you a mature, feature-rich blogging platform that you control. With over two decades of development, Publify provides a stable foundation for your blog with all the features modern bloggers need.
Whether you’re starting a personal blog, team publication, or content marketing site, Publify on Klutch.sh offers the flexibility and reliability for professional blogging.