Fetching contributors…
Cannot retrieve contributors at this time
77 lines (58 sloc) 3.5 KB
title: Installing Lucky
order: 1
intro: >
Learn how to install Crystal, Lucky, and the required dependencies. Lucky
works on macOS and Linux machines. A few dependencies are required before
getting started.
## Install Required Dependencies
To get Lucky, you need to install these first.
* Install one of these process managers: [Overmind (recommended)](,
[Heroku CLI (great if you plan to use Heroku to deploy)](,
or [foreman](
* [Node]( Requires at least v6
* [Yarn](
* [Crystal v0.27](
* Postgres ([macOS]([Others](
* Necessary libraries: On Debian (Ubuntu should be similar) run "apt-get install libc6-dev libevent-dev libpcre2-dev libpng-dev libssl1.0-dev libyaml-dev zlib1g-dev"
* Necessary libraries on Fedora (28): run "dnf install glibc-devel libevent-devel pcre2-devel openssl-devel libyaml-devel zlib-devel libpng-devel". libpng-devel is for Laravel Mix
## Install Lucky
Once the required dependencies are installed, set up Lucky for your system.
### On macOS
* Install [Homebrew](
* Run `brew install openssl` to make sure you have OpenSSL
* Run `brew tap luckyframework/homebrew-lucky`
* Run `brew install lucky`
* Make sure [Postgres CLI tools](
are installed if you're using
* If you are on macOS High Sierra you need to add `export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig`
to your `~/.bash_profile` or `~/.zshrc`
> If you get an error like this: `Package libssl/libcrypto was not found in the
pkg-config search path` then be sure to run the last step listed above so that
Crystal knows where OpenSSL is located.
### On Linux
* `git clone` the CLI repo at
* cd into the newly cloned directory
* Check out latest [released version]( `git checkout v0.12.0`
* Run `shards install`
* Run `crystal build src/ --release --no-debug`
* Move the generated `lucky` binary to your path. Most of the time you can move
it to `/usr/local/bin` and it should work.
If you needed different steps, please help contribute to this section by
[editing this page on GitHub](
## Start a New Project
To start a new project, run `lucky init`.
This will start the new project wizard. You can set up the project name, choose API only,
and whether you want Lucky to generate authentication for you.
## Running a Lucky Project
To start the server and run your project, first change into the directory for your
newly created app with `cd {project_name}`. Then run `bin/setup` to install dependencies
and `lucky dev` to start the server.
Running `lucky dev` will use an installed process manager (Overmind, Foreman,
etc.) to start the processes defined in ``. By default
`` will start the lucky server, and will start asset compilation.
> Lucky will look for a number of process managers. So if you prefer Forego
and someone else on your team prefers to use Overmind, `lucky dev` will work
for both of you.