---
title: 'Tutorial: Upgrade the Access Server Docker Image'
canonical: https://openvpn.net/as-docs/v3/tutorials/tutorial--upgrade-docker-image/
product: Access Server Docs
description: Upgrade the Access Server Docker image while maintaining your existing configurations and data.
---

# Tutorial: Upgrade the Access Server Docker Image

## Overview

Upgrading the Access Server (AS) Docker image ensures you have the latest security patches, features, and improvements. This tutorial teaches you how to upgrade the AS Docker image while maintaining your existing configurations and data. The process involves pulling the latest image, identifying the current data directory, and running the upgrade container using the same data path.

## Prerequisites

- Docker installed on your system.
- The current Access Server Docker container running and configured.
- Administrative access to the server hosting the Docker container.
- Basic knowledge of using the command line and Docker commands

## Step 1: Pull the latest Access Server Docker image

1. Connect to your server where your current Access Server Docker container is running. This is typically done via SSH:

   ```
   ssh your-username@your-server-ip
   ```

   Replace with your SSH user.

   Replace with the IP address of the server running Docker.
2. Once connected, run the following command to pull the latest Access Server version image from Ducker Hub:

   ```
   docker pull openvpn/openvpn-as:latest
   ```

   - This downloads the most up-to-date image, preparing it for deployment in later steps.

## Step 2: Identify the data folder used by the existing container

To preserve your existing configuration and data, ensure you identify which folder Access Server uses to store this information.

1. Run the following command to inspect the container:

   ```
   docker inspect openvpn-as
   ```

   - This command returns detailed information about the container.
2. Look for the `"HostConfig":` section, and within it, check the `"Binds":` array. An example output might look like:

   ```
   "HostConfig": {
       "Binds": [
           "/ExampleHostFolder/:/openvpn"
       ]
   }
   ```
3. The `/ExampleHostFolder/` is the directory on the host system where Access Server stores configuration and database files. This path is critical for a successful upgrade.

## Step 3: Stop and remove the old Access Server container

1. Before running the upgrade container, stop and remove the existing Access Server container:

   ```
   docker stop openvpn-as
   docker rm openvpn-as
   ```

   - Stopping and removing the old container ensures no conflicts when running the new one.

## Step 4: Run the new container using the existing data folder

Now that you've downloaded the latest image and identified the data folder used by the previous container, you can launch the new container.

- Ensure the path to the data folder remains the same to allow the new container to use your existing configuration:

  ```
  docker run -d \
    --name=openvpn-as --device /dev/net/tun \
    --cap-add=MKNOD --cap-add=NET_ADMIN \
    -p 943:943 -p 443:443 -p 1194:1194/udp \
    -v <path to data>:/openvpn \
    --restart=unless-stopped \
    openvpn/openvpn-as
  ```

  Provides access to the TUN device for VPN traffic.

  Allows the container to create device nodes.

  Grants the container the necessary network administration capabilities.

  Opens up the necessary ports: 943 for the Admin Web UI, 443 for TCP, and 1194 for UDP.

  Location for storing the Access Server configuration files. Replace **\<path to data\>** with your preferred file path.

  Tells Docker to automatically restart the container if it stops unexpectedly or the Docker daemon restarts, but not if you explicitly stop it.
- This command starts a new container running the latest Access Server version with the previous configuration and database files.

## Step 5: Verify the upgrade

1. Verify a successful upgrade by checking the status of the container:

   ```
   docker ps
   ```
2. Additionally, you can access the Access Server Admin Web UI to confirm that the version is updated and your settings are intact.

---

Prev: [Tutorial: Update Your Access Server Version](https://openvpn.net/as-docs/v3/tutorials/tutorial--update-access-server.md)
Next: [Tutorial: Upgrade the Access Server Helm Chart](https://openvpn.net/as-docs/v3/tutorials/tutorial--upgrade-access-server-helm-chart.md)
Index: https://openvpn.net/as-docs/llms.txt
