Installing IHP
IHP uses the Nix package manager to manage all dependencies of your application. This guide will walk you through installing Nix, IHP, and setting up your development environment.The first time you set up IHP, installation might take 10-15 minutes. Subsequent projects will be much faster as packages are cached.
Prerequisites
Install Nix Package Manager
IHP uses the Nix package manager to manage dependencies like PostgreSQL and the Haskell compiler.We recommend using the Determinate Nix Installer:Determinate Nix comes with Flakes and lazy-trees enabled by default, so no additional configuration is needed.
Nix is the equivalent of
npm for JavaScript, but for Haskell and much more. It manages all your application dependencies in development and production.Install IHP
Once Nix is installed, you can install IHP:This installs the
ihp-new command which you’ll use to create new IHP projects.Install direnv
IHP uses direnv to automatically load environment variables from Next, enable
.env files:direnv in your shell by following the instructions from the direnv website.Set Up Your Editor
Configure your editor for the best IHP development experience:
- VS Code
- Sublime Text
- Emacs
- Vim / NeoVim
Required Extensions:
- direnv extension (essential for environment loading)
- Haskell extension (for syntax highlighting and language support)
What Is Nix?
While the installation is running, take a look at “What Is Nix” by Shopify to understand how Nix works. Nix ensures that:- All dependencies are available in development and production
- Your development environment is reproducible
- Team members have identical setups
- PostgreSQL and other services are automatically managed
Troubleshooting
If you encounter any errors during installation:- Check the troubleshooting section for quick solutions
- Join the IHP Slack community for help
Using Cachix (Recommended)
If you don’t already use cachix, you may be prompted to install it during your first project setup. While not required, cachix is highly recommended as it dramatically reduces build times by providing pre-built binaries. Learn more about cachix at cachix.org.Next Steps
Quick Start
Create your first IHP application
Your First Project
Follow the complete tutorial to build a blog