Skip to main content

Quick Start Guide

This guide will get you up and running with IHP in just a few minutes. You’ll create a new project, start the development server, and see your first Haskell web application in action.
Before starting, make sure you’ve completed the installation guide.

Create Your First Project

1

Create a New Project

Use the ihp-new command to create a new project:
ihp-new my-app
This creates a new directory called my-app with all the files and structure needed for an IHP application.
Windows Users: Make sure you’re in the Linux part of the filesystem (not on a path starting with /mnt/), otherwise PostgreSQL will have issues accessing the database.
2

Navigate to Your Project

cd my-app
3

Start the Development Server

devenv up
The development server will:
  • Start a PostgreSQL database
  • Launch the web application
  • Start a WebSocket server for live reloading
  • Open the built-in IDE
The very first time you start the server might take a while and may require a restart. If needed, press CTRL+C and run devenv up again.
4

Open Your Application

By default, your application is available at:
If ports 8000 and 8001 are already in use, IHP will automatically pick the next available ports (e.g., 8002 and 8003).

Your First Code Change

Let’s experience IHP’s live reloading by making a simple change:
1

Open the Welcome View

Open Web/View/Static/Welcome.hs in your text editor.
2

Edit the HTML

Find the line with It's working! and replace it with:
Hello World from Haskell!
3

Watch the Magic

Save the file and watch your browser automatically refresh with the changes!
The auto-refresh uses a diff-based approach with morphdom, so it won’t reset your page state.

Project Structure

Here’s what ihp-new created for you:
File/DirectoryPurpose
Application/Your domain logic lives here
Application/Schema.sqlDatabase schema and tables
Web/Controller/Web application controllers
Web/View/HTML template files
Web/Types.hsCentral place for web application types
Config/Framework and application configuration
static/Images, CSS, and JavaScript files
flake.nixDeclares app dependencies (like package.json for NPM)
.ghciConfig for the Haskell interpreter

What’s Running?

The development server automatically manages:
  • PostgreSQL Database: No manual setup needed
  • Web Server: Serves your application
  • WebSocket Server: Powers live reloading
  • Development Tools: Code generators, schema designer, and logs
To stop the server, press CTRL+C

Next Steps

Now that you have IHP running, you’re ready to build something real:

Build Your First Project

Follow the complete tutorial to build a blog application with posts and comments

Explore the Schema Designer

Design your database schema with a visual interface

Use Code Generators

Generate controllers, views, and actions automatically

View Application Logs

Monitor SQL queries and application logs in real-time

Tips

  • Place your text editor and browser side-by-side to see live reloading in action
  • The development server shows helpful error messages when things go wrong
  • IHP is built by terminal hackers - everything can be done from the command line if you prefer
  • Changes to Haskell files are usually reflected in less than 50ms

Getting Help

If you run into any issues:

Build docs developers (and LLMs) love