- Follow the FP Complete get started guide to get the Stack build tool.
- On POSIX systems, this is usually
curl -sSL https://get.haskellstack.org/ | sh
- On POSIX systems, this is usually
- Create a new scaffolded site:
stack new my-project yesodweb/sqlite && cd my-project
- NOTE: You can see other template options on Github.
- Install the yesod command line tool:
stack install yesod-bin --install-ghc
- Build libraries:
stack build
- Launch devel server:
stack exec -- yesod devel
- View your Yesod site at http://localhost:3000/
NOTE: If you get an error message about GHC_PACKAGE_PATH
at step (5), you
need to install a newer version of yesod-bin. Try running stack build
yesod-bin-1.4.11
and rerunning stack exec -- yesod devel
. Also, if you choose
the "mini" scaffolding, yesod devel
will not work.
NOTE: Stack version 2 or later is required to create the scaffold.
System libraries
Note that you will need the dev version of some system libraries to be available for the above steps to work. For example, on Ubuntu, you may need to run something like:
sudo apt-get install -y build-essential zlib1g-dev
If you're using a database, you'll likely need to install the system libraries to talk to it. Some Ubuntu examples are:
sudo apt-get install -y libmysqlclient-dev
sudo apt-get install -y libpq-dev
Learn more
Now it's time to start coding! You can play around with the code right now, or if you want to learn more, check out these resources:
- Yesod book
- Community
- The Wiki
- Haskell Documentation
- Screencasts
- Cloning FluxBB (blog post about writing a forum in Yesod with Esqueleto)
- Yesod tutorial (slightly outdated, book provides more up-to-date content)