Apollo Development Environment Setup

This article describes how to set up the Baidu Apollo development environment.

Introduction

Apollo is a high performance, flexible architecture which accelerates the development, testing, and deployment of Autonomous Vehicles.

This article was written on July 7, 2025, based on Apollo version 10.0.

Environment

My system environment:

  • Intel(R) Core(TM) i9-14900K
  • NVIDIA GeForce RTX 2080 Ti
  • Ubuntu 22.04.5 LTS

Please install Docker Engine and GPU support yourself. You may refer to the Docker official documentation and Apollo Installation Guide[1].

Package Management Installation

Install Apollo Environment Manager

Apollo Environment Manager is a command-line tool that helps manage and launch Apollo environments.

1. Install required dependencies

1
2
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

2. Add Apollo software source GPG key and configure source

1
2
3
4
5
6
7
8
9
10
11
# Add GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://apollo-pkg-beta.cdn.bcebos.com/neo/beta/key/deb.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/apolloauto.gpg
sudo chmod a+r /etc/apt/keyrings/apolloauto.gpg

# Configure source and update
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/apolloauto.gpg] https://apollo-pkg-beta.cdn.bcebos.com/apollo/core"\
$(. /etc/os-release && echo "$VERSION_CODENAME") "main" | \
sudo tee /etc/apt/sources.list.d/apolloauto.list
sudo apt-get update

3. Install aem

1
sudo apt install apollo-neo-env-manager-dev --reinstall

After installation, you can use:

1
aem -h

Install Example Project

1. Select an example project

Apollo currently provides 3 example projects. You can choose one as needed:

  • application-core: contains all open-source Apollo packages, suitable for building your own application.

  • application-pnc: contains only planning and control packages, suitable for users focusing on that area.

  • application-perception: contains only perception-related packages.

Alternatively, you can use the full Apollo source project: apollo

Note: Starting from Apollo 10.0, both source and package modes use the same build tool. It is recommended to use the unified build commands below. Scripts such as dev_start.sh, dev_into.sh, apollo.sh are no longer recommended.

2. Clone the project

Taking application-core as an example:

1
git clone https://github.com/ApolloAuto/application-core.git

3. Start and enter the Apollo environment

1
2
3
4
5
6
7
8
9
10
11
12
# Enter project directory
cd application-core

# Switch environment configuration, will automatically recognize your host environment to switch .env and .workspace.json configuration
# If you use apollo source code, you don't need to perform this step, aem will automatically recognize the starting environment.
bash setup.sh

# Start container
aem start

# If you prefer using host machine instead of docker:
aem start -b host

Note: In host mode, subsequent operations are the same as in container mode. You can later run aem enter in the project root to enter the environment, either as a docker container or an Apollo bash shell.

4. Install packages

The example project includes a core directory with core/cyberfile.xml that describes dependencies to install:

1
2
3
4
buildtool build -p core

# Or build all code and packages:
buildtool build

This command builds the core package. Since it contains no source code, this step only installs dependencies from core/cyberfile.xml.

Note: New buildtool versions use –opt –gpu by default (if GPU is available). Use –dbg for gdb debugging.

You might encounter permission errors:

1
PermissionError: [Errno 13] Permission denied: 'tools/proto/proto.bzl'

Use sudo chmod 777 tools/proto/proto.bzl to resolve. Repeat for other files as needed.

5. Select vehicle profile

The profiles/sample directory provides an official config with 1 radar and 2 cameras. You can create your own vehicle profile based on this. To apply a profile:

1
2
# Example: apply sample profile
aem profile use sample

6. Play record data

Get map for the record
1
buildtool map get sunnyvale

Starting with version 9.0.0-rc-r10, map data is no longer bundled and must be downloaded separately. Use buildtool map list to view all available maps.

Launch Dreamview+
1
aem bootstrap start --plus

Other steps can be found in the Play Record section below.

Source Code Installation

Download and Install Apollo Source Code

1. Clone Apollo source code

Execute the following commands to clone Apollo source code:

1
2
3
4
5
# SSH method
git clone git@github.com:ApolloAuto/apollo.git

# HTTPS method
git clone https://github.com/ApolloAuto/apollo.git

Check out to the latest branch:

1
2
cd apollo
git checkout master

2. Start Apollo environment container

In the apollo directory, enter the following command to start the environment container:

Note: If your graphics card is RTX 40 series and you have properly installed the drivers, refer to RTX 40 series image support for operations.

1
bash docker/scripts/dev_start.sh

After successful operation, you will see the following output:

1
2
3
4
[ OK ] Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ OK ] To login into the newly created apollo_dev_michael container, please run the following command:
[ OK ] bash docker/scripts/dev_into.sh
[ OK ] Enjoy!

3. Enter Apollo environment container

In the apollo directory, enter the following command to enter the container:

1
bash docker/scripts/dev_into.sh

4. Build

In the /apollo directory inside the container, execute the following command to build the entire project:

1
./apollo.sh build

If you need to enable build optimization, use the following command:

1
./apollo.sh build_opt

5. Start Apollo for record playback verification

Launch Dreamview+
1
bash scripts/bootstrap.sh start_plus

Other steps can be found in the Play Record section below.

Play Record

Get the record

1
wget https://apollo-system.cdn.bcebos.com/dataset/6.0_edu/demo_3.5.record -P $HOME/.apollo/resources/records/

Play record in Dreamview+

After launching Dreamview+, go to localhost:8888 in your browser. You can select Default Mode or other modes. We’ll use Default Mode here.

Dreamview+ Welcome Page

  1. Select Default Mode.
  2. Check Accept the User Agreement and Privacy Policy, then click Enter this Mode.
  3. On Mode Settings page:
    • Under Operations, select Record
    • Under Environment Resources > Records, select the desired record
    • Under Environment Resources > HDMap, select Sunnyvale Big Loop
  4. Click the Play button at the bottom
    Play Record
    You’ll see the record playback in the Vehicle Visualization panel.

Play record via command line

  1. Enter docker environment.
  2. After downloading the record in Dreamview+ > Resource Manager > Records, run:
1
cyber_recorder play -f ~/.apollo/resources/records/demo_3.5.record

Tip: Add -l to loop playback. Without -l, it plays once.

Using Dreamview

New versions (around 9.0 and above) recommend using Dreamview+. Dreamview’s path planning and other features may be inconvenient or unavailable due to lack of maintenance.

Dreamview+

Go to http://localhost:8888/

Waiting for loading

Enter Default Mode

Play record

Select Record

Select Map

Play Record

Route Editing

Switch to Sim Control mode, open Planning module, enter Route Editing

Use Initial Point and Way Point to set start, waypoints, and end points, drag the mouse to set direction, click Save Editing to save and exit

Click Start to run

Dreamview

Go to http://localhost:8899/

Basic Interface

Start Sim Control

Open Planning module, enter Route Editing

Directly click to set route points, drag the mouse to set direction, click Send Routing Request

Vehicle Driving

Troubleshooting

  1. If you see a blank page at Dreamview+ localhost:8888, try clearing your browser cache, you can also try this if you encounter other display issues.
  2. After git clone, remember to git checkout to the correct version.
  3. When building Apollo 7.0 from source, you might encounter the following issues:
1
2
3
4
5
6
(21:25:48) ERROR: An error occurred during the fetch of repository 'zlib':
Traceback (most recent call last):
File "/apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/zlib/temp2343066494928926687/zlib-1.2.11.tar.gz: GET returned 404 Not Found
(21:25:49) ERROR: /apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/com_google_protobuf/BUILD:210:11: @com_google_protobuf//:protobuf depends on @zlib//:zlib in repository @zlib which failed to fetch. no such package '@zlib//': java.io.IOException: Error downloading [https://zlib.net/zlib-1.2.11.tar.gz] to /apollo/.cache/bazel/540135163923dd7d5820f3ee4b306b32/external/zlib/temp2343066494928926687/zlib-1.2.11.tar.gz: GET returned 404 Not Found

At this point, you need to add the following content to the WORKSPACE file in the apollo directory to fix the zlib download address. This should be added after workspace(name = "apollo") on the first line of the file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "zlib",
urls = ["https://github.com/madler/zlib/archive/refs/tags/v1.2.11.tar.gz"],
sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
strip_prefix = "zlib-1.2.11",
build_file_content = """
cc_library(
name = "zlib",
srcs = glob(["*.c"]),
hdrs = glob(["*.h"]),
includes = ["."],
visibility = ["//visibility:public"],
)
""",
)

References

  1. Baidu. 安装指南. 2024. Archived on 2025-07-07. Retrieved 2025-07-07.
  2. Baidu. 源码安装方式. 2023. Archived on 2025-07-16. Retrieved 2025-07-16.

Apollo Development Environment Setup
https://blog.zhanganzhi.com/en/2025/07/18a74626a42a/
Author
Andy Zhang
Posted on
July 7, 2025
Licensed under