Acestream in Docker

Acestream is software that allows multimedia streaming using P2P technology.

In order to install it with docker, I used a VM in proxmox, but it also can be done in any other hardware that you consider appropriate. It’s possible to do it with a raspberry pi, but as it has a different cpu architecture (arm) the process is a little different and I won’t cover that here.

1. Install docker

Wether on a VPS, a VM or a container, install docker following the official recommendations. If you want to follow the same steps as me, first start by setting up a ubuntu 20 LTS machine, and then install docker.

Don’t forget to update your system, running sudo apt update && sudo apt upgrade -y and then rebooting.

2. Clone the repository

The docker image creator makes everything really easy. Firstly we need to clone his repo:

git clone https://github.com/magnetikonline/docker-acestream-server

If you don’t have git, use sudo apt install git

Run the scripts

Once it has finished downloading the files, go ahead and go inside the new folder. The following script will automatically download the docker image.

sudo ./build.sh

Then, our container will be ready. Let’s start the service with:

sudo ./run.sh

Nevertheless, if we are on linux the author recommends to use run-tmpfs.sh instead, for a better caché files optimization.

Provide the hash

One way or another, our acestream server is now ready and waiting for orders. Start a new terminal session, go again into the repo folder and use the following script:

sudo ./playstream.py --ace-stream-pid <hash> --progress --service <ip>

Replace “hash” with the streaming id that you want to watch. The –progress option informs every 2 seconds the streaming status. In “ip” you will want to put the local ip of the machine running the server, because later it will be easier to copy the stream link. All the options of this script are detailed in his repository.

It’s all done! To watch the content, copy the newly generated link and paste it in VLC.

Little extra utility

It can be a little painful to run these commands every time you want to watch something. For this reason I created a very simple bash script that runs them at once.

If you want it too, create the file with touch startstraming.sh and edit with nano startstreaming.sh. Copy and paste the following commands:

1
2
3
4
5
#!/bin/bash

/home/angel/docker-acestream-server/run.sh &
sleep 6
/home/angel/docker-acestream-server/playstream.py --ace-stream-pid $1 --progress --server $2

Obviously, change the path to the files with your own.

Give it execution permissions: chmod +x startstreaming.sh

Now, you need to pass the hash id and the ip as parameters, just like before:

sudo ./startstreaming.sh <hash> <IP>