* refactor: move business logic from servers model * refactor: move containersModel initialization * refactor: added protocol ui controller and removed settings class from protocols model * refactor: moved cli management to separate controller * refactor: moved app split to separate controller * refactor: moved site split to separate controller * refactor: moved allowed dns to separate controller * refactor: moved language logic to separate ui controller * refactor: removed Settings from devices model * refactor: moved configs and services api logit to separate core controller * refactor: added a layer with a repository between the storage and controllers * refactor: use child parent system instead of smart pointers for controllers and models initialization * refactor: moved install functions from server controller to install controller * refactor: install controller refactoring * chore: renamed exportController to exportUiController * refactor: separate export controller * refactor: removed VpnConfigurationsController * chore: renamed ServerController to SshSession * refactor: replaced ServerController to SshSession * chore: moved qml controllers to separate folder * chore: include fixes * chore: moved utils from core root to core/utils * chore: include fixes * chore: rename core/utils files to camelCase foramt * chore: include fixes * chore: moved some utils to api and selfhosted folders * chore: include fixes * chore: remove unused file * chore: moved serialization folder to core/utils * chore: include fixes * chore: moved some files from client root to core/utils * chore: include fixes * chore: moved ui utils to ui/utils folder * chore: include fixes * chore: move utils from root to ui/utils * chore: include fixes * chore: moved configurators to core/configurators * chore: include fixes * refactor: moved iap logic from ui controller to core * refactor: moved remaining core logic from ApiConfigsController to SubscriptionController * chore: rename apiNewsController to apiNewsUiController * refactor: moved core logic from news ui controller to core * chore: renamed apiConfigsController to subscriptionUiController * chore: include fixes * refactor: merge ApiSettingsController with SubscriptionUiController * chore: moved ui selfhosted controllers to separate folder * chore: include fixes * chore: rename connectionController to connectiomUiController * refactor: moved core logic from connectionUiController * chore: rename settingsController to settingsUiController * refactor: move core logic from settingsUiController * refactor: moved core controller signal/slot connections to separate class * fix: newsController fixes after refactoring * chore: rename model to camelCase * chore: include fixes * chore: remove unused code * chore: move selfhosted core to separate folder * chore: include fixes * chore: rename importController to importUiController * refactor: move core logic from importUiController * chore: minor fixes * chore: remove prem v1 migration * refactor: remove openvpn over cloak and openvpn over shadowsocks * refactor: removed protocolsForContainer function * refactor: add core models * refactor: replace json with c++ structs for server config * refactor: move getDnsPair to ServerConfigUtils * feat: add admin selfhosted config export test * feat: add multi import test * refactor: use coreController for tests * feat: add few simple tests * chore: qrepos in all core controllers * feat: add test for settings * refactor: remove repo dependency from configurators * chore: moved protocols to core folder * chore: include fixes * refactor: moved containersDefs, defs, apiDefs, protocolsDefs to different places * chore: include fixes * chore: build fixes * chore: build fixes * refactor: remove q repo and interface repo * feat: add test for ui servers model and controller * chore: renamed to camelCase * chore: include fixes * refactor: moved core logic from sites ui controller * fix: fixed api config processing * fix: fixed processed server index processing * refactor: protocol models now use c++ structs instead of json configs * refactor: servers model now use c++ struct instead of json config * fix: fixed default server index processing * fix: fix logs init * fix: fix secure settings load keys * chore: build fixes * fix: fixed clear settings * fix: fixed restore backup * fix: sshSession usage * fix: fixed export functions signatures * fix: return missing part from buildContainerWorker * fix: fixed server description on page home * refactor: add container config helpers functions * refactor: c++ structs instead of json * chore: add dns protocol config struct * refactor: move config utils functions to config structs * feat: add test for selfhosted server setup * refactor: separate resources.qrc * fix: fixed server rename * chore: return nameOverriddenByUser * fix: build fixes * fix: fixed models init * refactor: cleanup models usage * fix: fixed models init * chore: cleanup connections and functions signatures * chore: cleanup updateModel calls * feat: added cache to servers repo * chore: cleanup unused functions * chore: ssxray processing * chore: remove transportProtoWithDefault and portWithDefault functions * chore: removed proto types any and l2tp * refactor: moved some constants * fix: fixed native configs export * refactor: remove json from processConfigWith functions * fix: fixed processed server index usage * fix: qml warning fixes * chore: merge fixes * chore: update tests * fix: fixed xray config processing * fix: fixed split tunneling processing * chore: rename sites controllers and model * chore: rename fixes * chore: minor fixes * chore: remove ability to load backup from "file with connection settings" button * fix: fixed api device revoke * fix: remove full model update when renaming a user * fix: fixed premium/free server rename * fix: fixed selfhosted new server install * fix: fixed updateContainer function * fix: fixed revoke for external premium configs * feat: add native configs qr processing * chore: codestyle fixes * fix: fixed admin config create * chore: again remove ability to load backup from "file with connection settings" button * chore: minor fixes * fix: fixed variables initialization * fix: fixed qml imports * fix: minor fixes * fix: fix vpnConnection function calls * feat: add buckup error handling * fix: fixed admin config revok * fix: fixed selfhosted awg installation * fix: ad visability * feat: add empty check for primary dns * chore: minor fixes
Amnezia VPN
The best client for self-hosted VPN
English | Русский
Amnezia is an open-source VPN client, with a key feature that enables you to deploy your own VPN server on your server.
Website | Alt website link | Documentation | Troubleshooting
Tip
If the Amnezia website is blocked in your region, you can use an Alternative website link.
Features
- Very easy to use - enter your IP address, SSH login, password and Amnezia will automatically install VPN docker containers to your server and connect to the VPN.
- Classic VPN-protocols: OpenVPN, WireGuard and IKEv2 protocols.
- Protocols with traffic Masking (Obfuscation): OpenVPN over Cloak plugin, Shadowsocks (OpenVPN over Shadowsocks), AmneziaWG and XRay.
- Split tunneling support - add any sites to the client to enable VPN only for them or add Apps (only for Android and Desktop).
- Windows, MacOS, Linux, Android, iOS releases.
- Support for AmneziaWG protocol configuration on Keenetic beta firmware.
Links
- https://amnezia.org - Project website | Alternative link (mirror)
- https://docs.amnezia.org - Documentation
- https://www.reddit.com/r/AmneziaVPN - Reddit
- https://t.me/amnezia_vpn_en - Telegram support channel (English)
- https://t.me/amnezia_vpn_ir - Telegram support channel (Farsi)
- https://t.me/amnezia_vpn_mm - Telegram support channel (Myanmar)
- https://t.me/amnezia_vpn - Telegram support channel (Russian)
- https://vpnpay.io/en/amnezia-premium/ - Amnezia Premium
Tech
AmneziaVPN uses several open-source projects to work:
- OpenSSL
- OpenVPN
- Shadowsocks
- Qt
- LibSsh - forked from Qt Creator
- and more...
Checking out the source code
Make sure to pull all submodules after checking out the repo.
git submodule update --init --recursive
Development
Want to contribute? Welcome!
Help with translations
Download the most actual translation files.
Go to "Actions" tab, click on the first line. Then scroll down to the "Artifacts" section and download "AmneziaVPN_translations".
Unzip this file. Each *.ts file contains strings for one corresponding language.
Translate or correct some strings in one or multiple *.ts files and commit them back to this repository into the client/translations folder.
You can do it via a web-interface or any other method you're familiar with.
Building sources and deployment
Check deploy folder for build scripts.
How to build an iOS app from source code on MacOS
-
First, make sure you have XCode installed, at least version 14 or higher.
-
We use QT to generate the XCode project. We need QT version 6.6.2. Install QT for MacOS here or QT Online Installer. Required modules:
- MacOS
- iOS
- Qt 5 Compatibility Module
- Qt Shader Tools
- Additional Libraries:
- Qt Image Formats
- Qt Multimedia
- Qt Remote Objects
-
Install CMake if required. We recommend CMake version 3.25. You can install CMake here
-
You also need to install go >= v1.16. If you don't have it installed already, download go from the official website or use Homebrew. The latest version is recommended. Install gomobile
export PATH=$PATH:~/go/bin
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
- Build the project
export QT_BIN_DIR="<PATH-TO-QT-FOLDER>/Qt/<QT-VERSION>/ios/bin"
export QT_MACOS_ROOT_DIR="<PATH-TO-QT-FOLDER>/Qt/<QT-VERSION>/macos"
export QT_IOS_BIN=$QT_BIN_DIR
export PATH=$PATH:~/go/bin
mkdir build-ios
$QT_IOS_BIN/qt-cmake . -B build-ios -GXcode -DQT_HOST_PATH=$QT_MACOS_ROOT_DIR
Replace PATH-TO-QT-FOLDER and QT-VERSION to your environment
If you get gomobile: command not found make sure to set PATH to the location
of the bin folder where gomobile was installed. Usually, it's in GOPATH.
export PATH=$(PATH):/path/to/GOPATH/bin
- Open the XCode project. You can then run /test/archive/ship the app.
If the build fails with the following error
make: ***
[$(PROJECTDIR)/client/build/AmneziaVPN.build/Debug-iphoneos/wireguard-go-bridge/goroot/.prepared]
Error 1
Add a user-defined variable to both AmneziaVPN and WireGuardNetworkExtension targets' build settings with
key PATH and value ${PATH}/path/to/bin/folder/with/go/executable, e.g. ${PATH}:/usr/local/go/bin.
if the above error persists on your M1 Mac, then most probably you need to install arch based CMake
arch -arm64 brew install cmake
Build might fail with the "source files not found" error the first time you try it, because the modern XCode build system compiles dependencies in parallel, and some dependencies end up being built after the ones that require them. In this case, simply restart the build.
How to build the Android app
Tested on Mac OS
The Android app has the following requirements:
- JDK 11
- Android platform SDK 33
- CMake 3.25.0
After you have installed QT, QT Creator, and Android Studio, you need to configure QT Creator correctly.
- Click in the top menu bar on
QT Creator->Preferences->Devicesand select the tabAndroid. - Set path to JDK 11
- Set path to Android SDK (
$ANDROID_HOME)
In case you get errors regarding missing SDK or 'SDK manager not running', you cannot fix them by correcting the paths. If you have some spare GBs on your disk, you can let QT Creator install all requirements by choosing an empty folder for Android SDK location and clicking on Set Up SDK. Be aware: This will install a second Android SDK and NDK on your machine!
Double-check that the right CMake version is configured: Click on QT Creator -> Preferences and click on the side menu on Kits. Under the center content view's Kits tab, you'll find an entry for CMake Tool. If the default selected CMake version is lower than 3.25.0, install on your system CMake >= 3.25.0 and choose System CMake at <path> from the drop-down list. If this entry is missing, you either have not installed CMake yet or QT Creator hasn't found the path to it. In that case, click in the preferences window on the side menu item CMake, then on the tab Tools in the center content view, and finally on the button Add to set the path to your installed CMake.
Please make sure that you have selected Android Platform SDK 33 for your project: click in the main view's side menu on Projects, and on the left, you'll see a section Build & Run showing different Android build targets. You can select any of them, Amnezia VPN's project setup is designed in a way that all Android targets will be built. Click on the targets submenu item Build and scroll in the center content view to Build Steps. Click on Details at the end of the headline Build Android APK (the Details button might be hidden in case the QT Creator Window is not running in full screen!). Here we are: Choose android-33 as Android Build Platform SDK.
That's it! You should be ready to compile the project from QT Creator!
Development flow
After you've hit the build button, QT-Creator copies the whole project to a folder in the repository parent directory. The folder should look something like build-amnezia-client-Android_Qt_<version>_Clang_<architecture>-<BuildType>.
If you want to develop Amnezia VPNs Android components written in Kotlin, such as components using system APIs, you need to import the generated project in Android Studio with build-amnezia-client-Android_Qt_<version>_Clang_<architecture>-<BuildType>/client/android-build as the projects root directory. While you should be able to compile the generated project from Android Studio, you cannot work directly in the repository's Android project. So whenever you are confident with your work in the generated project, you'll need to copy and paste the affected files to the corresponding path in the repository's Android project so that you can add and commit your changes!
You may face compiling issues in QT Creator after you've worked in Android Studio on the generated project. Just do a ./gradlew clean in the generated project's root directory (<path>/client/android-build/.) and you should be good to go.
License
This project is licensed under the GNU General Public License v3.0 (see LICENSE) and also includes third-party components distributed under their own terms (see THIRD_PARTY_LICENSES.md).
Donate
Patreon: https://www.patreon.com/amneziavpn
Bitcoin: bc1qmhtgcf9637rl3kqyy22r2a8wa8laka4t9rx2mf
USDT BEP20: 0x6abD576765a826f87D1D95183438f9408C901bE4
USDT TRC20: TELAitazF1MZGmiNjTcnxDjEiH5oe7LC9d
XMR: 48spms39jt1L2L5vyw2RQW6CXD6odUd4jFu19GZcDyKKQV9U88wsJVjSbL4CfRys37jVMdoaWVPSvezCQPhHXUW5UKLqUp3
TON: UQDpU1CyKRmg7L8mNScKk9FRc2SlESuI7N-Hby4nX-CcVmns
Acknowledgments
This project is tested with BrowserStack. We express our gratitude to BrowserStack for supporting our project.

