| name | odin-install |
| description | Install and configure the Odin programming language. Use when:
- Setting up Odin on a new machine
- Updating Odin to latest version
- Configuring Odin language server (ols)
|
Odin Installation
Quick Install (Linux)
Step 1: Get the download URL for the latest release:
curl -sL https://api.github.com/repos/odin-lang/Odin/releases/latest | grep -o '"browser_download_url": "[^"]*linux[^"]*amd64[^"]*"' | head -1 | cut -d'"' -f4
Step 2: Download using the URL from Step 1 (replace URL as needed):
curl -L "https://github.com/odin-lang/Odin/releases/download/dev-2025-12a/odin-linux-amd64-dev-2025-12a.tar.gz" -o /tmp/odin.tar.gz
Step 3: Extract and install:
sudo tar -xzf /tmp/odin.tar.gz -C /opt/
Step 4: Find the extracted directory and create symlink:
ls /opt/ | grep odin
sudo ln -sf /opt/odin-linux-amd64-nightly+2025-12-04/odin /usr/local/bin/odin
Step 5: Verify installation:
odin version
Prerequisites
Linux (Debian/Ubuntu)
clang++ -v
sudo apt install libstdc++-12-dev
sudo apt install libsdl2-dev
macOS
brew install odin
brew install sdl2
From Source
sudo apt install llvm-17 clang-17 lld-17
git clone https://github.com/odin-lang/Odin
cd Odin
make release-native
export PATH="$PWD:$PATH"
Language Server (OLS) and Formatter
Install OLS from Source
cd /tmp && git clone --depth 1 https://github.com/DanielGavin/ols.git
cd /tmp/ols && ./build.sh
./odinfmt.sh
sudo cp /tmp/ols/ols /usr/local/bin/
sudo cp /tmp/ols/odinfmt /usr/local/bin/
which ols odinfmt
Check if OLS is installed
which ols odinfmt
Configure OLS (ols.json in project root)
After installing, create ols.json in your project root:
{
"$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/ols.schema.json",
"collections": [
{ "name": "core", "path": "/opt/odin-linux-amd64-nightly+2025-12-04/core" },
{ "name": "vendor", "path": "/opt/odin-linux-amd64-nightly+2025-12-04/vendor" }
],
"enable_semantic_tokens": true,
"enable_snippets": true,
"enable_inlay_hints": true,
"enable_hover": true,
"enable_document_symbols": true,
"enable_format": true,
"enable_procedure_snippet": true,
"enable_references": true,
"odin_command": "/usr/local/bin/odin"
}
Note: Adjust the collection paths to match your actual Odin install directory (use ls /opt/ | grep odin).
Using odinfmt
odinfmt /path/to/file.odin
odinfmt -w /path/to/file.odin
echo 'package main; main :: proc() { x:=1 }' | odinfmt -stdin
Project Setup
mkdir my-project && cd my-project
mkdir -p src build
cat > src/main.odin << 'EOF'
package main
import "core:fmt"
main :: proc() {
fmt.println("Hello, Odin!")
}
EOF
cat > ols.json << 'EOF'
{
"$schema": "https://raw.githubusercontent.com/DanielGaworski/ols/master/misc/ols.schema.json",
"collections": [
{ "name": "core", "path": "ODIN_ROOT/core" },
{ "name": "vendor", "path": "ODIN_ROOT/vendor" }
]
}
EOF
cat > Makefile << 'EOF'
.PHONY: build run clean debug test
build:
odin build src -out:build/app
run: build
./build/app
debug:
odin build src -out:build/app -debug
clean:
rm -rf build/
test:
odin test src -out:build/test
EOF
cat >> .gitignore << 'EOF'
build/
*.o
*.obj
EOF
make run
Verify Installation
odin version
odin report
odin run -file:src/main.odin
Update Odin
Step 1: Remove old version:
sudo rm -rf /opt/odin-*
Step 2: Follow the Quick Install steps above to download and install the latest version.
Step 3: Verify the update:
odin version
Troubleshooting
"atomic.h not found"
sudo apt install libstdc++-12-dev
LLVM version mismatch
odin report
LLVM_CONFIG=/usr/bin/llvm-config-17 make release-native
SDL2 not found
sudo apt install libsdl2-dev