How to Install SWAG on Linux Mint Latest
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.
Prerequisites
Before we start, we need to make sure that the following packages are installed:
- Docker
- Docker Compose
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.
Install SWAG
Follow the steps below to install SWAG on Linux Mint Latest:
- First, clone the SWAG repository from Github:
git clone https://github.com/linuxserver/docker-swag.git
- Next, navigate to the
docker-swagdirectory:
cd docker-swag
- Now, we need to create a
.envfile to store all of our environment variables for the SWAG container. To create a new.envfile, execute the following command:
nano .env
- In the
.envfile, enter the following environment variables:
# General Settings
TZ=yourtimezone
URL=yourdomain.com
SUBDOMAINS=www,
VALIDATION=http
DNSPLUGIN=cloudflare
[email protected]
# Cloudflare Settings
[email protected]
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 (httpordns).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
.envfile.Run the following command to start the SWAG container:
docker-compose up -d
- Wait for the container to start up. You can check the status by running the following command:
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.