Installing Lua
Installing Lua on Windows, macOS, and Linux
Lua is a lightweight, fast, and embeddable scripting language commonly used in game development, embedded systems, and configuration scripting. If you're getting started with Lua, the first step is to get it installed on your machine. Here's how you can install Lua on Windows, macOS, and Linux.
Installing Lua on Windows
There are multiple ways to install Lua on Windows, but the most straightforward is using LuaBinaries or Chocolatey.
Method 1: Using LuaBinaries (Manual Installation)
- Go to https://www.lua.org/ftp/
- Download the latest Lua Windows binaries (e.g.,
lua-5.4.x_Win64_bin.zip
) - Extract the zip to a folder (e.g.,
C:\Lua
) - Add the Lua folder to the system PATH:
- Search for “Environment Variables”
- Edit the
Path
variable and add:C:\Lua
Method 2: Using Chocolatey (Recommended for Power Users)
If you have Chocolatey installed:
choco install lua
Verify the installation:
lua -v
Installing Lua on macOS
macOS users can install Lua easily using Homebrew.
Step-by-Step via Homebrew
- Install Homebrew (if you haven’t already):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Use Homebrew to install Lua:
brew install lua
- Check the installation:
lua -v
Installing Lua on Linux
The Lua package is available in most Linux distribution repositories.
On Ubuntu / Debian-based systems:
sudo apt update
sudo apt install lua5.4
On Fedora:
sudo dnf install lua
On Arch Linux / Manjaro:
sudo pacman -S lua