Deploying HeyForm
Introduction
HeyForm is an open-source form builder that creates engaging conversational forms for surveys, questionnaires, quizzes, and polls. Unlike traditional form builders, HeyForm presents questions one at a time in a conversational format, leading to higher completion rates and better user engagement.
Built with Node.js and React, HeyForm offers a drag-and-drop form builder with over 40 question types, logic branching, and customizable themes. The platform requires no coding skills and provides analytics to track form performance and response patterns.
Key highlights of HeyForm:
- Conversational Interface: One question at a time for better engagement
- 40+ Question Types: From text inputs to file uploads and payments
- Logic Branching: Create dynamic forms based on user responses
- Custom Themes: Brand your forms with custom colors and styles
- Analytics Dashboard: Track completion rates and response patterns
- Integrations: Connect with webhooks, Zapier, and other tools
- CAPTCHA Support: Prevent spam with Google reCAPTCHA or GeeTest
- Self-Hosted: Full control over your form data
This guide walks through deploying HeyForm on Klutch.sh using Docker, configuring the form builder, and creating your first conversational form.
Prerequisites
Before deploying HeyForm on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your HeyForm configuration
- A MongoDB database (can be deployed separately on Klutch.sh)
- A Redis instance for sessions (can be deployed separately)
- (Optional) SMTP credentials for email notifications
- Basic familiarity with Docker and containerization concepts
Preparing Your Repository
Create a GitHub repository with the following structure:
heyform-deploy/├── Dockerfile├── .dockerignore└── README.mdCreating the Dockerfile
Create a Dockerfile using the official HeyForm image:
FROM heyform/community-edition:latest
# Environment variablesENV APP_HOMEPAGE_URL=${APP_HOMEPAGE_URL}ENV SESSION_KEY=${SESSION_KEY}ENV FORM_ENCRYPTION_KEY=${FORM_ENCRYPTION_KEY}
# Database configurationENV MONGO_URI=${MONGO_URI}ENV REDIS_HOST=${REDIS_HOST}ENV REDIS_PORT=${REDIS_PORT:-6379}
# Expose the application portEXPOSE 9513
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:9513/health || exit 1Advanced Dockerfile with All Options
FROM heyform/community-edition:latest
# Application URLENV APP_HOMEPAGE_URL=${APP_HOMEPAGE_URL}
# Security keysENV SESSION_KEY=${SESSION_KEY}ENV FORM_ENCRYPTION_KEY=${FORM_ENCRYPTION_KEY}
# MongoDB configurationENV MONGO_URI=${MONGO_URI}ENV MONGO_USER=${MONGO_USER}ENV MONGO_PASSWORD=${MONGO_PASSWORD}
# Redis configurationENV REDIS_HOST=${REDIS_HOST}ENV REDIS_PORT=${REDIS_PORT:-6379}
# SMTP configurationENV SMTP_FROM=${SMTP_FROM}ENV SMTP_HOST=${SMTP_HOST}ENV SMTP_PORT=${SMTP_PORT:-587}ENV SMTP_USER=${SMTP_USER}ENV SMTP_PASSWORD=${SMTP_PASSWORD}
# File upload configurationENV UPLOAD_FILE_TYPES=${UPLOAD_FILE_TYPES:-.jpg,.png,.pdf,.doc,.docx}
EXPOSE 9513
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:9513/health || exit 1Environment Variables Reference
| Variable | Required | Description |
|---|---|---|
APP_HOMEPAGE_URL | Yes | Public URL of your HeyForm instance |
SESSION_KEY | Yes | Random string for session encryption |
FORM_ENCRYPTION_KEY | Yes | Random string for form data encryption |
MONGO_URI | Yes | MongoDB connection string |
REDIS_HOST | Yes | Redis server hostname |
REDIS_PORT | No | Redis port (default: 6379) |
SMTP_FROM | No | Email sender address |
SMTP_HOST | No | SMTP server hostname |
SMTP_PORT | No | SMTP port (default: 587) |
SMTP_USER | No | SMTP username |
SMTP_PASSWORD | No | SMTP password |
UPLOAD_FILE_TYPES | No | Allowed file upload extensions |
Deploying HeyForm on Klutch.sh
- Create a MongoDB app with persistent storage
- Create a Redis app for session management
- Note connection details for both services
- Select HTTP as the traffic type
- Set the internal port to 9513
Deploy Prerequisites
First, deploy MongoDB and Redis on Klutch.sh:
Generate Security Keys
Generate random strings for encryption:
openssl rand -hex 32 # For SESSION_KEYopenssl rand -hex 32 # For FORM_ENCRYPTION_KEYPush Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial HeyForm deployment configuration"git remote add origin https://github.com/yourusername/heyform-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “heyform” or “forms”.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your HeyForm repository.
Configure HTTP Traffic
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
APP_HOMEPAGE_URL | https://your-app-name.klutch.sh |
SESSION_KEY | Your generated session key |
FORM_ENCRYPTION_KEY | Your generated encryption key |
MONGO_URI | mongodb://your-mongo-app:27017/heyform |
REDIS_HOST | Your Redis app hostname |
REDIS_PORT | 6379 |
Attach Persistent Volumes
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/uploads | 20 GB | File upload storage |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will build the container, attach volumes, and start HeyForm with HTTPS enabled.
Access HeyForm
Once deployment completes, access your HeyForm instance at https://your-app-name.klutch.sh. Create your admin account on first access.
Using HeyForm
Creating Your First Form
- Log in to your HeyForm instance
- Click Create Form
- Choose a template or start from scratch
- Add questions using the drag-and-drop builder
- Configure form settings and publish
Question Types
HeyForm supports over 40 question types:
Basic:
- Short text, Long text
- Email, Phone number
- Number, Date
Choice:
- Multiple choice, Dropdown
- Picture choice, Rating
- Yes/No, Legal
Advanced:
- File upload, Payment
- Signature, Matrix
- Calculator, Hidden fields
Logic Branching
Create dynamic forms with conditional logic:
- Select a question
- Click Logic tab
- Add conditions based on previous answers
- Set jump destinations for each condition
Form Settings
Configure your form behavior:
- Welcome/Thank You screens: Customize messages
- Progress bar: Show completion progress
- Keyboard shortcuts: Enable for power users
- Submission limits: Set maximum responses
- Scheduling: Set start and end dates
Collecting Responses
View and manage responses:
- Navigate to your form
- Click Responses tab
- View individual responses or summary
- Export to CSV or Excel
Integrations
Webhooks
Send form data to external services:
- Go to form settings
- Click Integrations
- Add webhook URL
- Configure payload format
CAPTCHA
Prevent spam submissions:
- Go to Settings > Security
- Enable Google reCAPTCHA or GeeTest
- Enter your API credentials
- CAPTCHA appears on forms automatically
Troubleshooting
Form Not Loading
- Verify MongoDB and Redis are running
- Check environment variables are correct
- Review application logs for errors
File Upload Fails
- Check allowed file types configuration
- Verify upload directory permissions
- Ensure sufficient storage space
Email Notifications Not Sending
- Verify SMTP configuration
- Check SMTP credentials are correct
- Review mail logs for errors
Additional Resources
- Official HeyForm Website
- HeyForm GitHub Repository
- HeyForm Documentation
- HeyForm Docker Hub
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying HeyForm on Klutch.sh provides a powerful, self-hosted form builder with conversational interfaces that boost completion rates. The drag-and-drop builder, logic branching, and extensive question types make it easy to create engaging surveys and questionnaires. With full control over your data and extensive customization options, HeyForm on Klutch.sh is an excellent choice for organizations needing a privacy-focused form solution.