Skip to main content


These are just some of the ways in which one can deploy an ambiorix application.


Remember to open the open the port used by the application on your server. Also remember to define a port in the app or it will serve on a dynamic port unknown at run time.


There is now a load balancer for ambiorix applications so one can serve concurrent users with ease. The load balancer is documented here.


The application can be deployed as a service on any Linux server. Create a new .service in the /etc/systemd/system/ directory.


The name of the file defines the name of the service.

vim /etc/systemd/system/ambiorix.service

In that .service file place the following, it creates a service that runs the application at the defined path (path/to/app).

Description=Ambiorix application

ExecStart=cd path/to/app && /usr/bin/Rscript --no-save --slave -f app.R


One the service is added restart the daemon, you might have to run it as sudo.

systemctl daemon-reload

You can then start and enable the service, again, you might have to run it as sudo.

systemctl start ambiorix
systemctl enable ambiorix

Once the app has started, check its status to make sure that everything runs well.

systemctl status ambiorix


The easiest way to deploy an ambiorix app is using docker.

Existing Image

This project comes with an image you can pull and use.

docker pull jcoenep/ambiorix

By default the image will use an internal very basic application and binds it to port 3000.

docker run -p 3000:3000 jcoenep/ambiorix

To use your own application mount your app in the images /app directory, so from the root of the app this would look like this:

docker run -v "$(pwd)"/.:/app -p 3000:3000 jcoenep/ambiorix


Or you can generate your own dockerfile.

create_dockerfile(port = 3000L)

The function create_dockerfile will parse the DESCRIPTION file to create a Dockerfile, below is an example of the output.

FROM jcoenep/ambiorix
RUN echo "options(repos = c(CRAN = ''), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/
RUN R -e 'install.packages("remotes")'
RUN R -e "remotes::install_github('JohnCoene/echarts4r')"
COPY . .
RUN R -e "options('', 'ambiorix.port'=3000);source('app.R')"

You can then build the image.

docker build -t ambiorix .

Finally, run it.

docker run ambiorix

With docker installed this will work just as well on your machine as on a remote server.