Skip to content

Install Lua

The official Lua installation instructions are maintained at the Lua 5.5 readme.

Lua releases infrequently by design — stability is a core value of the project. The 5.5 release introduced a number of breaking changes, so this guide targets Lua 5.5 specifically.

The easiest path on macOS is Homebrew:

Terminal window
brew install lua

Verify the install:

Terminal window
lua -v
# Lua 5.5.x Copyright (C) 1994-2025 Lua.org, PUC-Rio
Terminal window
sudo apt update
sudo apt install lua5.5 liblua5.5-dev

If your distro’s package manager doesn’t carry 5.5 yet, build from source:

Terminal window
curl -R -O https://www.lua.org/ftp/lua-5.5.0.tar.gz
tar -xzf lua-5.5.0.tar.gz
cd lua-5.5.0
make all test
sudo make install

Download the prebuilt binaries from LuaBinaries and add the directory to your PATH.

Alternatively, use Scoop:

Terminal window
scoop install lua

Open a terminal and run the Lua REPL:

Terminal window
lua

You should see a prompt like:

Lua 5.5.0 Copyright (C) 1994-2025 Lua.org, PUC-Rio
>

Type print("hello") and press Enter. If you see hello printed back, you’re set. Press Ctrl+C or Ctrl+D to exit.

LuaJIT is a popular just-in-time compiler for Lua that offers significant performance gains. It targets Lua 5.1 compatibility, so it won’t run this guide’s 5.5-specific examples. Stick with standard Lua 5.5 for now.

We don’t need its features for this guide.

With Lua installed, head to Hello, World to write your first test.