To run Airstation on your machine, there are two ways: using Docker (recommended) or building it yourself using the Go compiler for server, Node.js with npm for web clients and also have FFmpeg installed on your system.
-
Clone Airstation repository
git clone https://github.com/cheatsnake/airstation.git
cd ./airstation -
Setup environment variables
Next you need an
.envfile with secret keystouch .env
Inside this file you must define 2 variables:
AIRSTATION_SECRET_KEY= AIRSTATION_JWT_SIGN=AIRSTATION_SECRET_KEY- the secret key you need to log in to the station control panel
AIRSTATION_JWT_SIGN- the key to sign the JWT sessionUse random string generator with a length of at least 10 characters for these variables!
-
Build a docker image and start a new container
docker compose up -d
And finally you can see:
- Control panel on http://localhost:7331/studio/ (extra slash matters!)
- Radio player on http://localhost:7331
To stop the container, just type:
docker compose downYou can get pre-built image from Docker Hub and run it quickly with custom docker-compose.yml file as shown bellow:
# docker-compose.yml
services:
airstation:
image: cheatsnake/airstation:latest
ports:
- "7331:7331"
volumes:
- airstation-data:/app/storage
- ./static:/app/static
restart: unless-stopped
environment:
AIRSTATION_SECRET_KEY: ${AIRSTATION_SECRET_KEY:-PASTE_YOUR_OWN_KEY}
AIRSTATION_JWT_SIGN: ${AIRSTATION_JWT_SIGN:-PASTE_RANDOM_STRING}
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:7331/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
airstation-data:Don't forget to modify environment variables inside this file or via your own
.envfile in the same directory as thedocker-compose.yml
-
Follow steps 1 and 2 from the previous section
-
Install dependencies
npm ci --prefix ./web/playernpm ci --prefix ./web/studio- Build web clients
npm run build --prefix ./web/playernpm run build --prefix ./web/studio- Build server
go build ./cmd/main.go- Run app
./mainMake sure you have FFmpeg installed on your system.
See the result on http://localhost:7331 and http://localhost:7331/studio/ (extra slash matters!)
To run the application in development mode, start each part of the application using the commands below:
npm run dev --prefix ./web/playernpm run dev --prefix ./web/studiogo run ./cmd/main.go