Learn Robotics
Module: Build And Share

Deployment

How to get software onto real robots — Docker containers, cross-compilation, over-the-air updates, and deployment best practices.

8 min read

Deployment

Your code works perfectly on your laptop. Ubuntu 22.04, x86-64, all the right libraries installed. But your robot runs:

  • ARM processor (not x86)
  • Embedded Linux (not full Ubuntu)
  • Limited storage (8GB, not 500GB)
  • No keyboard, mouse, or monitor

How do you get your software from development machine to robot?

The Deployment Challenge

Robotics deployment is harder than web deployment:

ChallengeWeb AppsRobots
PlatformSame CPU everywhere (x86 cloud servers)Different CPUs (ARM, RISC-V, custom SoCs)
ConnectivityAlways onlineOften offline, intermittent network
UpdatesDeploy instantly, rollback if neededUpdate takes time, rollback is risky
TestingTest in staging environmentCan't easily test on real hardware
Failure costWebsite is downRobot is stranded/broken

We need deployment strategies that handle these constraints.

Cross-Compilation

Your laptop is x86-64. Your robot is ARM. You can't just copy the executable.

Cross-compilation means building code on one architecture to run on another.

Cross-compile for ARM (Rust example)

The compiled binary runs on ARM Linux, even though it was built on x86.

Note

Some languages (like Python) are interpreted, so they don't need cross-compilation — Python bytecode runs anywhere. But native extensions (like OpenCV bindings) still need to be built for the target architecture.

Containers (Docker)

Instead of installing dependencies manually on each robot, package everything in a container.

Dockerfile for robot software

Build the container image:

docker build -t my_robot_app:1.2.3 -f Dockerfile.arm64 .

Deploy to robot:

# Save image as tar file
docker save my_robot_app:1.2.3 > robot_app.tar

# Copy to robot (over SSH)
scp robot_app.tar robot@10.0.0.5:/tmp/

# Load on robot
ssh robot@10.0.0.5 "docker load < /tmp/robot_app.tar"

# Run container
ssh robot@10.0.0.5 "docker run -d --name camera my_robot_app:1.2.3"

Benefits:

  • Reproducible — same environment on every robot
  • Isolated — dependencies don't conflict with system packages
  • Portable — works on any robot with Docker installed
  • Versioned — tag images like 1.2.3, easy rollback
Warning

Containers add overhead (storage, memory, startup time). For resource-constrained robots (like microcontrollers), you may need to deploy bare binaries instead. But for anything running Linux on ARM/x86, containers are worth it.

Over-the-Air (OTA) Updates

Manually SSHing into robots doesn't scale. For fleets of 10+ robots, you need over-the-air updates.

Simple OTA update system

Production OTA systems also:

  • Verify updates with cryptographic signatures (prevent malicious updates)
  • Support incremental downloads (only download what changed)
  • Roll back automatically if the new version crashes
  • Schedule updates during idle time (not mid-mission)
Tip

Always keep a "known good" version on the robot. If an update fails, the robot should automatically revert. Never leave a robot in a bricked state where it can't boot.

Deployment Checklist

Before deploying to a real robot:

  1. Test in simulation — run full system tests
  2. Cross-compile — verify binary works on target architecture
  3. Test on a dev robot — deploy to one robot first, not the fleet
  4. Monitor health — check CPU, memory, disk usage after deploy
  5. Have a rollback plan — keep previous version ready
  6. Update documentation — record what changed and how to revert

What's Next?

You've built, tested, and deployed your robot software. But robotics is a collaborative field. In the final lesson, we'll explore contributing to open source — how to share your work, get feedback, and help build the robotics ecosystem.

Got questions? Join the community

Discuss this lesson, get help, and connect with other learners on Discord.

Join Discord

Discussion

Sign in to join the discussion.