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:

  1. First, clone the SWAG repository from Github:
git clone https://github.com/linuxserver/docker-swag.git
  1. Next, navigate to the docker-swag directory:
cd docker-swag
  1. Now, we need to create a .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
  1. In the .env file, 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 (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.

  1. Once you have entered your environment variables, save and close the .env file.

  2. Run the following command to start the SWAG container:

docker-compose up -d
  1. 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.