Get pion/ion up and running

April 18, 2021 , posted under Golang Webrtc Pion

Things we need install before installing ion

  1. nats.io
  2. redis
  3. Golang (latest version)

1. Installing Nats.io

On MacOs

1
2
> brew update
> brew install nats-server

On Windows

1
> choco install nats-server

On Linux

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
> curl -L https://github.com/nats-io/nats-server/releases/download/v2.0.0/nats-server-v2.0.0-linux-amd64.zip -o nats-server.zip

> unzip nats-server.zip -d nats-server
Archive:  nats-server.zip
   creating: nats-server-v2.0.0-linux-amd64/
  inflating: nats-server-v2.0.0-linux-amd64/README.md
  inflating: nats-server-v2.0.0-linux-amd64/LICENSE
  inflating: nats-server-v2.0.0-linux-amd64/nats-server

> sudo cp nats-server/nats-server-v2.0.0-linux-amd64/nats-server /usr/bin

2. Installing Redis

On Macos

1
2
> brew update
> brew install redis

On Windows

1
> choco install redis-64

On Ubuntu

1
> sudo apt install redis-server

3. Installing golang

On MacOs

1
2
> brew update
> brew install go

On Windows

1
> choco install golang

On Linux

1
2
3
4
> cd ~
> wget -c https://dl.google.com/go/go1.16.3.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
> export PATH=$PATH:/usr/local/go/bin
> source ~/.profile

to verify the go version

1
> go version
1
2
output
go version go1.16.3 linux/amd64

Lets begin building

Now we have everthing we need to build ion from source, things we need clone the source code from github.

things we need

  1. ion
  2. ion-app-web
  3. ion-app-flutter

lets make a directory to put everthing into

1
2
mkdir ionapp
cd ionapp

1. clone ion source

1
> git clone https://github.com/pion/ion.git

2. clone ion web app

1
> git clone https://github.com/pion/ion-app-web.git

3. clone ion flutter app

1
> git clone https://github.com/pion/ion-app-flutter.git

Now we should have all 3 projects in our ionapp directory we can start building from source now.

Building ion from source

1
2
> cd ion
> make build

this will download all the dependencies and build the bin files into the bin folder, once its finished.

1
> cd bin

you should see 4 files name as follow, avp, biz, islb and sfu.
once its confirm its there lets spin up the server Start all services

1
2
//make sure you back into the ion root folder before you run this
> ./scripts/all start

Stop all services

1
> ./scripts/all stop

now all the server side stuff is up and running, we will spin up the clients to do some testing.

Start up the webapp

1
2
> cd ion-app-web
> npm i

wait until this finishes then

1
> npm start

bob’s your uncle you should see the ion web app, just enter an room name and a user name and you can test it out

Start up the flutter app

first

1
> ./scripts/project_tools.sh create
1
> cd ion-app-flutter

For Android/IOS

1
> flutter run

For MacOS

1
> flutter run -d macos

For Web

1
> flutter run -d chrome

as of flutter 2.0 the web and desktop has been stable, other words you have one code base that can build mobile/desktop clients.

Conclusion

I hope this help you get started with pion/ion, as this is a truely a turn key solution for web conferencing system/cluster, especially with the advantage of having the cross platform clients, below i will provide the links for you also there is a slack channel for pion and ion, see you in there

my github: https://github.com/jason-shen

ion github: https://github.com/pion/ion
ion-app-web github: https://github.com/pion/ion-app-web
ion-app-flutter gihub: https://github.com/pion/ion-app-flutter

pion slack channel: https://gophers.slack.com/archives/CAK2124AG
ion slack channel: https://gophers.slack.com/archives/C01EVC86FAR

.Site.Param.name

About

I'm a FullStack developer, specialise with webrtc, voip, web and mobile apps and i love anything that is related to technology

Join the Newsletter

Subscribe to get my latest content & deal for my incoming courses.
You're signing up to receive emails from Jason Shen