Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM ruby:3.1
# Install dependencies
RUN apt-get update && apt-get install -y \
nodejs \
npm \
libpq-dev \
imagemagick \
&& rm -rf /var/lib/apt/lists/*
# Install yarn
RUN npm install -g yarn
WORKDIR /app
# Clone Publify
RUN git clone https://github.com/publify/publify.git . && \
git checkout stable
# Install Ruby dependencies
RUN bundle config set --local without 'development test' && \
bundle install
# Install JavaScript dependencies
RUN yarn install
# Precompile assets
ENV RAILS_ENV=production
ENV SECRET_KEY_BASE=placeholder_for_precompile
RUN bundle exec rails assets:precompile
# Create required directories
RUN mkdir -p tmp/pids tmp/cache log public/uploads
# Remove placeholder
ENV 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
*.md
LICENSE
.gitignore
*.log
.DS_Store
tmp/
log/

Deploying Publify on Klutch.sh

    Generate Secret Keys

    Generate secret keys for Rails:

    Terminal window
    # Secret key base
    ruby -rsecurerandom -e "puts SecureRandom.hex(64)"

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile .dockerignore
    git commit -m "Initial Publify deployment configuration"
    git remote add origin https://github.com/yourusername/publify-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 “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:

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

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    RAILS_ENVproduction
    SECRET_KEY_BASEYour generated secret key
    DATABASE_URLpostgresql://user:pass@host/publify
    RAILS_SERVE_STATIC_FILEStrue
    RAILS_LOG_TO_STDOUTtrue

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /app/public/uploads20 GBUploaded media files
    /app/log1 GBApplication logs

    Deploy Your Application

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

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Publify container
    • Provision an HTTPS certificate

    Run Database Setup

    After deployment, initialize the database:

    Terminal window
    bundle exec rails db:setup

    Access 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:

  1. Blog title and tagline
  2. Admin account creation
  3. 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

  1. Go to Admin > Articles > New
  2. Enter title and content
  3. Use Markdown or visual editor
  4. Add categories and tags
  5. Set publication date
  6. Publish or save as draft

Content Types

TypeDescription
ArticlesStandard blog posts
PagesStatic content pages
NotesShort-form content (like tweets)

Media Management

Upload and manage media:

  1. Go to Admin > Media
  2. Upload images and files
  3. Insert into articles via editor

Customization

Themes

Change your blog’s appearance:

  1. Go to Admin > Design > Themes
  2. Browse available themes
  3. Activate desired theme
  4. Customize with Sidebar components

Add functionality to your sidebar:

  • Recent articles
  • Categories
  • Archives
  • Search
  • Custom HTML

User Management

User Roles

RolePermissions
AdminFull access to all features
PublisherCreate and publish content
ContributorCreate content (no publish)

Creating Users

  1. Go to Admin > Users
  2. Click “Add User”
  3. Set username and password
  4. Assign role
  5. Save user

SEO Configuration

Meta Tags

Configure SEO settings:

  1. Go to Admin > Settings > SEO
  2. Set default meta description
  3. Configure canonical URLs
  4. 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_FILES is 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

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.