How to Install SWAG (Secure Web Application Gateway) on NixOS Latest
Introduction
SWAG (Secure Web Application Gateway) is a Docker-based reverse proxy and one of the easiest and simplest ways to access your web applications securely. In this tutorial, we will be installing SWAG on NixOS latest.
Prerequisites
Before proceeding with this tutorial, you need to have the following prerequisites installed on your system:
- A working NixOS latest installation.
- Docker installed on your NixOS machine.
Installation
The following steps will help you to install SWAG on NixOS latest:
- Open your NixOS terminal.
- Clone the SWAG GitHub repository using the following command:
git clone https://github.com/linuxserver/docker-swag
- Once you have cloned the repository, navigate to the cloned directory:
cd docker-swag
- Copy the
.env.samplefile to.env:
cp .env.sample .env
- Open the
.envfile in your favorite text editor and configure the following settings:
# Domain name for your SWAG server
DOMAIN=yourdomain.com
# Email address to register SSL certificate request
[email protected]
# Enable Let's Encrypt SSL verification
STAGING=false
# Path to your SWAG data folder
DATA_DIR=/path/to/swag/data
# Path to your Nginx configuration folder
NGINX_DIR=/path/to/swag/nginx/
# Path to your Nginx.conf file
NGINX_CONF=/path/to/swag/nginx/nginx.conf
# Path to your Apache SSL configuration
APACHE_SSL_DIR=/path/to/swag/apache/
# Path to your Caddyfile
CADDYFILE=/path/to/swag/caddy/Caddyfile
# Path to your PHP configuration file
PHP_INI=/path/to/swag/php/php.ini
# Path to your HTTP/HTTPS certification folder
CERT_DIR=/path/to/swag/certs/
- Create a new Docker network using the following command:
docker network create swag
- Run the SWAG Docker container using the following command:
docker-compose up -d
- Verify that the SWAG container is running by executing the following command:
docker ps
You should see the SWAG container listed in the output.
Congratulations! You have successfully installed SWAG on NixOS latest.
Conclusion
In this tutorial, we have shown you how to install SWAG (Secure Web Application Gateway) on NixOS latest. SWAG is a simple and efficient way to access your web applications securely. With SWAG, you can enjoy a secure and reliable web experience, with the confidence that your data is protected.