DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
VGSOURCES
Get listed

Agent ZeroPATCH 2026.10.27

How to Run Agent Zero With Docker Compose on a VPS

By VGSources Team 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Run Agent Zero as a Docker Compose service, keep its web port private, and place Apache with HTTPS in front of it. The reliable layout is a host .env mounted at /a0/.env, a persistent host directory mounted at /a0/usr, host port 50080 mapped to container port 80, and restart: unless-stopped. For a VPS, plan on at least 2 GB RAM, 20 GB storage and 1 vCPU; 4 GB or more RAM, 50 GB storage and 2 or more vCPUs are recommended by the Agent Zero VPS Deployment Guide (updated December 21, 2025).

The steps below create the container, preserve data across recreation, terminate public HTTP at Apache, add WebSocket support and TLS, and complete Agent Zero’s provider onboarding without exposing the application directly to the internet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As an Amazon Associate I earn from qualifying purchases.

What VPS specifications and access do you need?

Use a 64-bit Linux VPS that can run Docker and accept SSH connections. The published VPS guide lists the following baseline and recommended capacity:

Requirement Minimum Recommended Why it matters
Memory 2 GB RAM 4 GB or more Agent Zero, its utilities and model integrations share the available memory.
Storage 20 GB 50 GB or more The persistent /a0/usr tree, logs, indexes and updates need free space.
CPU 1 vCPU 2 or more vCPUs Extra CPU headroom helps when tasks, embeddings or utilities run concurrently.
Docker Docker Engine 24.0+ Current supported release The container and Compose plugin must be available to the host.
Web server Apache 2.4+ Current supported release Required for the documented reverse-proxy, TLS and WebSocket setup.

You also need root or sudo access, a static VPS IP address, control of DNS for a domain or subdomain, and a certificate plan. The guide lists Ubuntu, Debian, AlmaLinux, CentOS and Rocky Linux compatibility. Check the current Agent Zero documentation before deployment because image tags, installer options and provider integrations can change.

Popular on Amazon
Sale
Gaoye Blue Light Blocking Glasses | Anti UV Ray, For Computers & Gaming, Square Frame, Eyewear for Men and Women
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Which deployment method should you choose?

Compose is the best fit when you want a readable, repeatable service definition and explicit control over persistence. The same image can also be installed through the A0 Install Quick Start, which reduces shell work but gives you less control over the generated layout.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Path Best for Trade-off
A0 Install Quick Start A first instance with minimal manual configuration The installer controls more of the instance layout.
Compose translation Operators who want declarative configuration and repeatable restarts You maintain the YAML and must preserve mounts during upgrades.
Compose plus Apache and TLS A public, domain-based production service DNS, certificates, proxy modules and authentication all need configuration.

This article uses the third path while retaining the documented Docker contract: the official agent0ai/agent-zero:latest image, port 80 in the container, /a0/.env for credentials and /a0/usr for persistent data.

How do you install Docker and Compose on the VPS?

Install Docker Engine, the Docker CLI, containerd, Buildx and the Docker Compose plugin from Docker’s official repository for your distribution. On Debian or Ubuntu, use Docker’s Debian/Ubuntu repository instructions. AlmaLinux, Rocky, CentOS and RHEL use Docker’s CentOS-repository path. Do not mix packages from unrelated repositories when you need a predictable Engine and Compose combination.

  1. Connect over SSH with an account that can use sudo.
  2. Install Docker Engine and the Compose plugin using the instructions for your distribution.
  3. Enable Docker at boot and start it.
  4. Confirm the installation with docker --version.
  5. Run docker run hello-world to verify that the daemon can pull and start a container.

If the final command fails, fix Docker permissions, firewall egress or repository configuration before creating the Agent Zero service. Running every command with sudo works, but adding your administrative user to Docker’s group is an alternative with security implications because Docker-group membership is effectively root-level access.

How do you create the Agent Zero directory and credentials?

Create a dedicated directory and the host-side persistence directory. Keeping the Compose project in one place makes upgrades and backups easier.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo mkdir -p /opt/agent-zero/usr
cd /opt/agent-zero
sudo nano .env

Put the Web UI credentials in /opt/agent-zero/.env:

AUTH_LOGIN=admin
AUTH_PASSWORD=replace-with-a-long-random-password

AUTH_LOGIN is the username; it is not a Boolean enable switch. Choose a password of at least eight characters, and use a longer random value for an internet-facing service. Shell-sensitive characters can be awkward in command lines, so enter the value directly in the file and protect the file permissions.

Also popular on Amazon
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo chmod 600 /opt/agent-zero/.env

The Compose file will mount this file read-only. Do not commit it to a public repository or paste it into support logs.

What should the Compose file contain?

Create /opt/agent-zero/compose.yml with the following service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
services:
  agent-zero:
    image: agent0ai/agent-zero:latest
    container_name: agent-zero
    restart: unless-stopped
    ports:
      - "127.0.0.1:50080:80"
    volumes:
      - ./.env:/a0/.env:ro
      - ./usr:/a0/usr

The image tag follows the documented VPS example. Pin a tested tag instead if your change-management process requires deterministic rollbacks, but record the tag and keep the same mounts. The 127.0.0.1 binding is an intentional hardening choice: only Apache on the VPS can reach port 50080, so the application is not directly exposed on the VPS’s public interfaces.

Do not mount the entire host project over /a0. The container’s application code lives there, and replacing it with a host directory can interfere with startup and future image upgrades. Persist only the documented data boundary, /a0/usr, plus the separate credentials file.

How do you start and verify the container?

  1. From /opt/agent-zero, pull the image: sudo docker compose pull.
  2. Create the service in the background: sudo docker compose up -d.
  3. Check its state: sudo docker compose ps.
  4. Inspect startup output if needed: sudo docker compose logs --tail=200 agent-zero.
  5. Probe the local endpoint: sudo curl -I http://127.0.0.1:50080/.

When authentication is configured, the deployment guide expects the local request to redirect to /login. That redirect is the expected protected-entry behavior; it is not a substitute for checking the container state and logs.

If the service exits, read the logs before changing the YAML. A typo in .env, a permissions problem in ./usr or an image-pull failure is easier to correct when the original error is still visible.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do you expose Agent Zero securely with Apache and HTTPS?

Use a DNS name and reverse proxy rather than publishing port 50080 directly. Create an A record such as a0.example.com pointing to the VPS’s static IP. Allow ports 80 and 443 through the VPS firewall, while leaving 50080 bound to loopback.

Also popular on Amazon
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men | Office Gifts for Women, iPhone Stand, Gadgets for Men, Office Decor, Gaming Desk Accessories for Samsung Fold 8, Switch, iPad
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Enable the required Apache modules

The VPS guide calls for Apache 2.4+ with proxying, WebSocket proxying, TLS, rewriting and headers support. On Debian- or Ubuntu-family systems, the module names are:

sudo a2enmod proxy proxy_http proxy_wstunnel ssl rewrite headers
sudo systemctl restart apache2

On distributions that do not provide a2enmod, enable the equivalent modules in the distribution’s Apache configuration. Confirm the modules are loaded before troubleshooting a gateway error.

Create an HTTP-to-HTTPS virtual host

Use an HTTP virtual host that does nothing except redirect the hostname to HTTPS:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<VirtualHost *:80>
    ServerName a0.example.com
    RewriteEngine On
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Replace the example hostname with the name in your DNS record. Keeping the redirect separate makes it clear that unencrypted requests never reach the application.

Create the HTTPS reverse-proxy virtual host

Proxy normal HTTP requests and WebSocket upgrades to the loopback port:

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName a0.example.com

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/a0.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/a0.example.com/privkey.pem

    ProxyPreserveHost On
    ProxyPass        / http://127.0.0.1:50080/
    ProxyPassReverse / http://127.0.0.1:50080/

    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteCond %{HTTP:Connection} upgrade [NC]
    RewriteRule ^/socket.io/(.*) ws://127.0.0.1:50080/socket.io/$1 [P,L]

    RequestHeader set X-Forwarded-Proto "https"
</VirtualHost>
</IfModule>

The WebSocket rule is important for real-time features. If the current Agent Zero release documents a different WebSocket path, use that documented path in the rule rather than guessing. Test the configuration before reloading:

sudo apache2ctl configtest
sudo systemctl reload apache2

On systems using the httpd command, run sudo httpd -t instead of apache2ctl configtest. A syntax error should be fixed before Apache is reloaded.

Also popular on Amazon
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack | IC+Rgb & W Smart RGB Light Bar, USB Powered TV Light Bar, Led Lights for TV PC Room Monitor Backlight Gaming Accessories
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

How do you obtain and renew the TLS certificate?

Certbot with Let’s Encrypt is one documented option. After DNS resolves to the VPS and Apache serves the hostname, install Certbot using your distribution’s package instructions and request a certificate for the exact name:

sudo certbot --apache -d a0.example.com

Certbot can write the certificate paths and redirect rules for you; review the resulting virtual host so the WebSocket proxy remains present. Verify automated renewal with:

sudo certbot renew --dry-run

DirectAdmin-managed certificates and commercial certificates are alternatives. If you install a certificate manually, keep the private key readable only by the account and services that require it, and arrange a reload after renewal.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should you do during Agent Zero’s first-run onboarding?

Open the HTTPS hostname and sign in with the credentials from .env. The current product documentation presents three provider choices: Cloud, AI-account and Local. Select the provider that matches where your models actually run, then choose a main model and a utility model.

Choose model roles deliberately

The main model handles the primary conversation and agent reasoning. Utility and embedding models have different jobs; embeddings support indexing and retrieval rather than ordinary chat. Changing the embedding model later can trigger reindexing, so decide whether the existing index can be rebuilt before changing it on a busy instance.

Connect to a model server on the VPS host

Inside a container, localhost and 127.0.0.1 refer to the container itself, not the VPS. For a model server running on the host, use host.docker.internal when it is available, or the Docker host-gateway address supplied by your setup. The model server must listen on an interface reachable from Docker, and its firewall must allow only the required private traffic.

Do not broaden a model server to the public internet merely to make the URL work. First verify container-to-host routing, then restrict the listener and firewall to the Docker network or host interface that Agent Zero uses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Also popular on Amazon
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do you preserve data, back up the instance and upgrade it?

The persistence boundary is the host directory mounted at ./usr:/a0/usr. Recreating the container does not remove that directory, while deleting it destroys the stored Agent Zero data. The credentials are separate in /opt/agent-zero/.env; back up both locations, and protect the backup as carefully as the live password file.

Make a simple stopped-service backup

  1. Stop the service so files are quiescent: sudo docker compose down.
  2. Archive the data and credentials to storage that is not the VPS disk:
sudo tar -czf /root/agent-zero-backup-$(date +%F).tgz -C /opt/agent-zero usr .env
  1. Bring the service back: sudo docker compose up -d.
  2. Store the archive off-server and periodically verify that it can be read.

Agent Zero also provides Settings → Backup & Restore and a built-in self-update flow. Those features complement, rather than replace, an independent copy of usr and .env.

Update while retaining the mounts

For an image update, back up first, then pull and recreate the service:

cd /opt/agent-zero
sudo docker compose pull
sudo docker compose down
sudo docker compose up -d
sudo docker compose ps

The VPS guide describes stopping and removing the old container before recreating it with the same credentials and /a0/usr mounts. Keep a backup before major updates, and inspect logs after startup. Losing either mount can look like a fresh installation or an authentication failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do you diagnose common failures?

Symptom Likely cause Checks and fix
Login rejects valid-looking credentials The environment variables are malformed, or the container has not reloaded the edited file. Confirm AUTH_LOGIN contains a username rather than true, inspect the file permissions and run docker compose down followed by docker compose up -d.
Apache returns 502 Bad Gateway The container is stopped or port 50080 is not bound. Run docker compose ps, inspect docker compose logs, and confirm curl -I http://127.0.0.1:50080/ works on the VPS.
Apache returns 504 Gateway Timeout The process is overloaded, stalled or repeatedly restarting. Check container logs, memory and CPU usage, then increase resources or correct the failing startup/configuration condition.
Chat or live features do not update Apache is proxying HTTP but not upgrading WebSocket connections. Verify mod_proxy_wstunnel, the upgrade rewrite rules and Apache’s syntax with apache2ctl configtest. Use wscat to test the WebSocket path when necessary.
Changes in .env appear ignored Environment values were read by the existing container at startup. Restart or recreate the service after editing the file, then check the logs for startup errors.
Data disappears after recreation The host directory was not mounted, or the wrong Compose working directory was used. Run Compose from /opt/agent-zero, inspect the service mounts and confirm that /opt/agent-zero/usr contains the expected files before removing any container.

What is the safest production checklist?

  • Use a current 64-bit Linux VPS with at least 2 GB RAM, 20 GB storage and 1 vCPU; choose the recommended 4 GB, 50 GB and 2-vCPU level when budget permits.
  • Install Docker Engine 24.0 or newer and the Compose plugin from the distribution-appropriate Docker repository.
  • Keep .env at the project root, mount it read-only and restrict its permissions.
  • Persist only /a0/usr; do not overlay the entire /a0 application directory.
  • Bind port 50080 to 127.0.0.1, not the public interface.
  • Point a DNS A record at the static VPS IP and proxy the hostname through Apache.
  • Enable HTTP-to-HTTPS redirection, TLS, authentication and WebSocket upgrades before sharing the URL.
  • Back up both usr and .env before upgrades, and keep an off-server copy.
  • Use Docker-reachable host addressing for local model servers; never assume container localhost means the VPS host.
  • Recheck the current Agent Zero, Docker and Apache documentation when changing image tags or provider settings.

Frequently Asked Questions

Can I change the Agent Zero login without rebuilding the image?

Yes. Edit the host .env file, keep AUTH_LOGIN as the desired username and replace AUTH_PASSWORD with the new value. Restart or recreate the Compose service so the container reads the changed environment at startup.

Where are Agent Zero conversations and indexes stored?

The deployment contract places persistent application data under the host directory mounted to /a0/usr. Back up that directory together with the separate .env file; deleting the host directory removes the data that survives container recreation.

Why does changing an embedding model take longer than changing a chat model?

Embeddings underpin the stored index, so changing the embedding model can require the index to be rebuilt. Plan the change during a maintenance window and confirm that the available storage and compute capacity can handle reindexing.

What should I check before exposing the hostname to users?

Verify DNS resolution, an HTTP-to-HTTPS redirect, a valid certificate, Web UI authentication and a working WebSocket upgrade. Also confirm that port 50080 remains reachable only on loopback and that backups of /a0/usr and .env exist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Agent ZeroApacheDocker ComposeHTTPSLinuxself-hostingVPS

Leave a reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.