The easiest modern way to install Lua is through your operating system’s package manager.
You should also install LuaRocks, which is the standard package manager for Lua libraries.
Windows
Recommended: Winget
Open Command Prompt or PowerShell:
winget install DEVCOM.Lua
Also download LuaRocks for Windows from the releases and run “luarocks.exe”.
Verify installation:
lua -v
luarocks --version
macOS
Recommended: Homebrew
Install using Homebrew:
brew install lua luarocks
Verify installation:
lua -v
luarocks --version
Linux
Ubuntu / Debian
sudo apt update
sudo apt install lua5.4 luarocks
Fedora
sudo dnf install lua luarocks
Arch Linux
sudo pacman -S lua luarocks
Verify installation:
lua -v
luarocks --version
Install Lua Package
Example:
luarocks install luasocket
Run Lua
Create a file:
hello.lua
Add:
print("Hello, World!")
Run it:
lua hello.lua
That’s it.
VIDEO GUIDE
Coming soon.

