Installation Guide
This guide covers detailed installation methods for deploying Halo in production environments. Choose the method that best fits your infrastructure and requirements.For a quick test installation, see the Quick Start guide.
Installation Methods
Docker
Recommended for most users - simple, portable, and consistent across platforms
Docker Compose
Best for production - easier configuration and multi-container orchestration
1Panel
Recommended for production - includes reverse proxy, SSL, and backup automation
Manual Installation
Advanced users who need custom configurations
System Requirements
Before installing Halo, ensure your system meets these requirements:Minimum Requirements
- CPU: 1 core
- RAM: 512MB (1GB recommended)
- Storage: 10GB free space
- Operating System: Linux, macOS, or Windows
- Java: JRE 21 or higher (for manual installation)
Software Requirements
- Docker 20.10+ (for Docker/Docker Compose installation)
- Docker Compose 2.0+ (for Docker Compose installation)
Docker Installation
The Docker installation method provides the simplest way to run Halo with all dependencies included.Basic Docker Deployment
Create data directory
Run Halo container
Halo will use the embedded H2 database by default, which is suitable for small to medium sites.
Docker with Environment Variables
You can customize Halo’s behavior using environment variables:JVM_OPTS: JVM options for memory configurationTZ: Timezone (defaults toAsia/Shanghai)HALO_WORK_DIR: Working directory (defaults to/root/.halo2)
Docker Compose Installation
Docker Compose provides better configuration management and is recommended for production deployments.Basic Docker Compose Setup
Create docker-compose.yml
Create a new directory for your Halo installation and create a
docker-compose.yml file:docker-compose.yml
Docker Compose with MySQL
For production environments, we recommend using an external database like MySQL:Database Configuration Options
Halo supports multiple databases. Configure the connection using command-line arguments:| Database | Connection String Format |
|---|---|
| H2 (default) | r2dbc:h2:file:///${halo.work-dir}/db/halo-next?MODE=MySQL&DB_CLOSE_ON_EXIT=FALSE |
| MySQL | r2dbc:pool:mysql://host:3306/database |
| MariaDB | r2dbc:pool:mariadb://host:3306/database |
| PostgreSQL | r2dbc:pool:postgresql://host:5432/database |
1Panel Installation (Recommended for Production)
1Panel is an open-source Linux server management panel that makes Halo deployment much easier. It provides:- One-click Halo installation
- Automatic reverse proxy configuration with Nginx
- SSL certificate management (Let’s Encrypt integration)
- Automated backup scheduling
- Easy upgrade management
Install 1Panel
- Install 1Panel on your Linux server by following the 1Panel installation guide
- Access the 1Panel web interface
- Navigate to the App Store
- Search for “Halo” and click Install
- Follow the installation wizard to configure:
- Domain name
- SSL certificate (automatic via Let’s Encrypt)
- Database settings
- Backup schedule
For detailed instructions, refer to the official 1Panel Halo deployment documentation.
Configuration
Application Configuration
Halo’s configuration is stored in the working directory (~/.halo2 by default). Key configuration files:
application.yaml: Main application configurationdb/: Database files (if using H2)themes/: Installed themesplugins/: Installed pluginsupload/: Uploaded media files
Port Configuration
To change the default port (8090), you can: Using environment variables:Memory Configuration
For better performance, adjust JVM memory settings:-Xmx: Maximum heap size-Xms: Initial heap size
Allocate memory based on your expected traffic and content volume. A typical small to medium site runs well with 512MB-1GB.
Post-Installation Steps
Complete setup wizard
Navigate to your Halo URL and complete the initial setup wizard to create your admin account.
Configure site settings
Access the admin console at
/console and configure:- Site title and description
- SEO settings
- Comment system
- Social media links
Install a theme
Visit the theme marketplace in the admin console to browse and install a theme that matches your vision.
Set up backups
Configure regular backups of your data directory:
/root/.halo2(or your configured work directory)- Database files (if using external database)
Updating Halo
Docker Update
Docker Compose Update
Troubleshooting
Container won’t start
-
Check Docker logs:
-
Verify port availability:
-
Check disk space:
Database connection errors
- Verify database container is healthy:
docker ps - Check database credentials in your configuration
- Ensure database service starts before Halo (use
depends_onin compose)
Performance issues
- Increase JVM memory allocation
- Use an external database instead of H2
- Enable caching in your reverse proxy
- Monitor resource usage:
docker stats halo
Getting Help
If you encounter issues during installation:- Review the official Halo documentation
- Check the community forum for similar issues
- Join the Telegram channel for community support
- Report bugs on GitHub
Next Steps
Theme Customization
Learn how to customize your site’s appearance with themes
Plugin Development
Extend Halo’s functionality by developing custom plugins
API Integration
Integrate Halo with external services using the REST API
Performance Optimization
Optimize your Halo installation for better performance