Autonomous Driving Simulator CARLA using Docker


CARLA, an open-source simulator for autonomous driving research, provides Docker images, and you can easily set up CARLA by using one of these Docker images.
In this article, we will show you how to set up CARLA using Docker.


CARLA (Car Learning to Act) is an open-source simulator based on Unreal Engine 4 for autonomous driving research.
For details, please visit the following site.

CARLA Setup using Docker

By using Docker image, you can easily set up CARLA.


  • Ubuntu 16.04 or later
  • Docker
  • NVIDIA Docker2
  • NVIDIA Driver >= 390

Setup CARLA Server

Use the following command to download the Docker image (Docker for CARLA) to be operated as a CARLA server.

$ docker pull carlasim/carla:0.8.4

Because the Docker image is large, downloading takes time.

Setup Python Client

Setup the Python client with the following command.

$ cd ~
$ wget
$ tar xf 0.8.4.tar.gz
$ rm 0.8.4.tar.gz
$ cd ~/carla-0.8.4
$ pip3 install -r PythonClient/requirements.txt

According to Docs, Python 3.5 is recommended, but Python code is also compatible with Python 2.7.

Execution of CARLA using Docker

Run CARLA Server

In the first terminal, execute the following command to start the CARLA server.

$ docker run --runtime=nvidia --rm -p 2000-2002:2000-2002 -e NVIDIA_VISIBLE_DEVICES=0 carlasim/carla:0.8.4

Run Python Client

On another terminal, execute the following command to start the Python client.
Here, we start which displays depth and semantic segmentation image in RGB image.

$ cd ~/carla-0.8.4/PythonClient
$ ./ --autopilot

The second line can be omitted as follows.

$ ./ -a

To obtain the output added Lidar image as the first image, execute the following command.

$ ./ --autopilot --lidar


We showed you how to set up CARLA using Docker.