Local Emulator Quickstart¶
Getting started with Pantavisor doesn't require physical hardware. You can experience the full "Local Development Loop" right on your laptop using the pantavisor-appengine Docker emulator. This emulator acts as a virtual device, allowing you to deploy and test containerized apps using the Pantavisor CLI (pvr).
Prerequisites¶
Before starting, ensure you have the following installed on your machine:
- Docker: For running the emulator.
- pvr: The Pantavisor CLI. You can install it via:
bash
curl -sL https://gitlab.com/pantacor/pvr/-/raw/master/install.sh | bash
1. Start the Local Emulator¶
First, create a Docker volume to act as the persistent storage for the virtual device. Then, start the pantavisor-appengine container.
# Create a local storage volume to persist device state
docker volume create pantavisor-storage
# Start the Pantavisor appengine
docker run --name pv-engine -d --privileged \
-v pantavisor-storage:/var/pantavisor/storage \
-p 12368:12368 \
pantavisor-appengine:latest
Note: The
--privilegedflag is required because Pantavisor orchestrates its own LXC containers internally. Port12368is exposed so that thepvrCLI can communicate with the emulator's local API.
Wait a few seconds for the emulator to finish booting up.
2. Clone the Device State¶
With the emulator running, you can interact with it just like a physical device on your network. Use pvr to clone the current state of the device to your laptop.
pvr clone http://localhost:12368/cgi-bin my-device
cd my-device
This command creates a new directory (my-device) containing the declarative state of the emulator.
3. Deploy an Application¶
Now, let's add a simple web server application to the device state and deploy the update back to the emulator.
- Add a container application from the Pantacor registry:
bash pvr app add --from-registry registry.gitlab.com/pantacor/pantavisor-web-status:master pwebstatus - Commit the changes and deploy them to the emulator:
bash pvr add . pvr commit pvr sig update pvr commit pvr post
4. Verify the Deployment¶
Pantavisor is now downloading and starting your new application container. To verify it worked, simply open your browser or use curl to access the web server running inside the emulator:
curl http://localhost:5001
You should see a status page returned by the pwebstatus container!
Next Steps¶
Now that you've experienced the speed and simplicity of the Pantavisor container workflow locally, you can: - Explore Pantabox for interactive local control. - Flash a Physical Device and deploy the same applications. - Sign up to Pantacor Hub to manage fleets of devices in the cloud.