How to Install SWAG on Kali Linux Latest

SWAG (Secure Web Application Gateway) is an open-source web application gateway that provides security, SSL/TLS, and reverse proxy capabilities. In this tutorial, we will show you how to install SWAG on Kali Linux latest version.

Prerequisites

Steps for Installing SWAG on Kali Linux Latest

Step 1: Pull SWAG Docker Image

The first step consists of pulling the SWAG Docker image from the Docker Hub repository. The command for pulling the image is:

docker pull linuxserver/swag

Step 2: Create a Docker Network

The next step is to create a Docker network for SWAG. This will allow you to connect your SWAG container to your other Docker containers. To create a Docker network, run the following command:

docker network create swag_network

Step 3: Create a Docker Volume

Creating a Docker volume is essential for persisting your SWAG configuration and logs between container restarts. To create a Docker volume, execute the following command:

docker volume create swag_config

Step 4: Start SWAG Container

Now, it's time to start the SWAG container by using the following command:

docker run -d \
  --name=swag \
  --cap-add=NET_ADMIN \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e URL=sub.domain.com \
  -e VALIDATION=http \
  -e EMAIL=youremail@example.com \
  -p 443:443 \
  -p 80:80 \
  -v /path/to/appdata/config:/config \
  -v /path/to/appdata/www:/www \
  --network swag_network \
  --restart unless-stopped \
  linuxserver/swag

Let's understand the above command:

Step 5: Test Your SWAG Installation

Finally, test your SWAG installation by opening a web browser and navigating to the URL you configured. If your configuration is correct, you should see your web application through a secure HTTPS connection.

Conclusion

In conclusion, this tutorial gives you an overview of how to install SWAG on Kali Linux latest version. By following the above steps, you can securely expose your web application to the internet with SSL/TLS protection.

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!