In this tutorial, we will be installing SWAG (Secure Web Application Gateway) on Linux Mint. SWAG is a reverse proxy that provides secure services for various applications. It is a Docker-based container that allows you to quickly and easily set up HTTPS for your web applications.
Before we start, we need to make sure that the following packages are installed:
If you don't have them yet, you can easily install them on your system. Execute the following commands:
sudo apt-get update
sudo apt-get install docker.io docker-compose -y
Once you have installed Docker and Docker Compose, you can start with the SWAG installation process.
Follow the steps below to install SWAG on Linux Mint Latest:
git clone https://github.com/linuxserver/docker-swag.git
docker-swag directory:cd docker-swag
.env file to store all of our environment variables for the SWAG container. To create a new .env file, execute the following command:nano .env
.env file, enter the following environment variables:# General Settings
TZ=yourtimezone
URL=yourdomain.com
SUBDOMAINS=www,
VALIDATION=http
DNSPLUGIN=cloudflare
EMAIL=youremail@gmail.com
# Cloudflare Settings
CF_API_EMAIL=youremail@gmail.com
CF_API_KEY=yourapikey
# Portainer Settings
USERDIR=/path/to/data
PGID=gid
PUID=uid
Make sure to replace the environment variables with your own values.
TZ: Enter your timezone (for example, America/Los_Angeles).
URL: Enter the URL of your domain.
SUBDOMAINS: Enter a comma-separated list of subdomains.
VALIDATION: Enter your validation method (http or dns).
DNSPLUGIN: Enter your DNS provider (cloudflare, namecheap, godaddy, etc.).
EMAIL: Enter your email address.
CF_API_EMAIL: Enter your Cloudflare email address.
CF_API_KEY: Enter your Cloudflare API key.
USERDIR: Enter the path to your data directory.
PGID: Enter the group ID of your user.
PUID: Enter the user ID of your user.
Once you have entered your environment variables, save and close the .env file.
Run the following command to start the SWAG container:
docker-compose up -d
docker-compose ps
Once the container status is Up, you can access your web applications securely via HTTPS.
Congratulations! You have successfully installed SWAG on Linux Mint Latest using Docker.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!