Tutorial: Initialize or Reset Access Server with ovpn-init
Initialize or reset OpenVPN Access Server using ovpn-init. Learn how to run interactive and batch setups, configure cloud environments, and safely perform factory resets.
Overview
ovpn-init is an initialization-only command-line tool included with OpenVPN Access Server. It's used to perform the initial configuration of a new installation or to reset an existing installation to factory defaults.
Use ovpn-init when:
Setting up Access Server for the first time on a cloud provider instance.
Performing a deliberate factory reset of an existing installation.
Warning: Destructive command
Running ovpn-init wipes all Access Server configuration settings, certificates, and user/group properties. This action can't be undone. Always back up your configuration before use. Active fixed license keys aren't removed.
Prerequisites
A running instance of Access Server.
Console access with the ability to get root privileges.
A backup of your configuration (for resets).
For batch mode: Review and accept the EULA (
ovpn-init --view-eula).
Tip
This command is safe to run. It only displays the End User License Agreement (EULA) and doesn't perform any initialization, reset, or configuration changes.
Connect to the console and get root privileges.
Run the following command:
ovpn-init --view-eula
Review the End User License Agreement.
Note
Using
--batchin any command indicates that you agree to the EULA.
Connect to the console and get root privileges.
Run the command appropriate for your environment:
Cloud provider initialization (interactive):
AWS EC2:
ovpn-init --ec2
Google Cloud Platform:
ovpn-init --gcp
Microsoft Azure:
ovpn-init --azure
Oracle Cloud:
ovpn-init --oracle
Factory reset (generic VM or non-cloud environment):
ovpn-init --force
Note
Cloud-specific flags apply recommended defaults for each platform and launch the interactive setup wizard.
After running
ovpn-init, follow the prompts in the terminal.Provide required configuration values when prompted.
Tip
Unless you're setting up a failover server, accept the default settings and adjust them later in the Admin Web UI. When prompted for an activation key, you can press Enter to add it later.
Connect to the console and get root privileges.
Ensure you have reviewed the EULA:
ovpn-init --view-eula
Run the command appropriate for your environment:
Cloud provider initialization (interactive):
AWS EC2:
ovpn-init --ec2 --batch --force
Google Cloud Platform:
ovpn-init --gcp --batch --force
Microsoft Azure:
ovpn-init --azure --batch --force
Oracle Cloud:
ovpn-init --oracle --batch --force
Factory reset (generic VM or non-cloud environment):
ovpn-init --batch --force
Warning
Don't use
--batchunless you've reviewed the EULA. Batch mode skips all prompts and runs non-interactively.
Run:
ovpn-init --help
Review available flags and usage details.
Reference: Available flags
Flag | Description |
|---|---|
Cloud provider | |
| Configure using Amazon EC2 user-defined metadata. |
| Configure using Google Cloud user-defined metadata. |
| Configure using Microsoft Azure user-defined metadata. |
| Configure using Oracle Cloud user-defined metadata. |
Reset and initialization behavior | |
| Re-initialize Access Server and wipe all databases. Required for factory resets. |
| Run non-interactively; Access Server will not prompt for TTY input. Using this flag indicates agreement with the EULA. See |
| Display the End User License Agreement before running. |
| Do not automatically start the Access Server daemon after the script completes. |
| Generate verbose output during initialization. |
Server configuration | |
| Set the fully qualified domain name (FQDN) of this server for internet access. |
| Configure this node as a secondary (backup or standby) node. |
| Use local authentication via Access Server's internal database. |
| Optionally specify an Access Server license key during initialization. |
Routing defaults | |
| Client traffic will not be routed through the VPN by default. |
| Client DNS traffic will not be routed through the VPN by default. |
| Private subnets will not be accessible to VPN clients by default. |
Cryptography | |
| Key algorithm for OpenVPN profiles and certificates. Valid values: |
| Key algorithm for self-signed web certificates. Uses the same valid values as |
| RSA key size for OpenVPN profiles and certificates. Use |
| RSA key size for self-signed web certificates. Use |