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
- Kali Linux latest version
- Docker installed and running on your system.
- Basic understanding of Docker
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 protected] \
-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:
- The "--name" parameter gives a name to the container, in this case, "swag".
- "--cap-add=NET_ADMIN" is used for setting up the needed networking capabilities.
- "-e PUID" and "-e PGID" are used to set the user and group ID for SWAG container.
- "-e TZ" is used to set the timezone.
- "-v /path/to/appdata/config:/config" mounts the "/path/to/appdata/config" to the "/config" folder in the container.
- "-v /path/to/appdata/www:/www" mounts the "/path/to/appdata/www" to the "/www" folder in the container.
- "--network swag_network" assigns the SWAG container to the "swag_network" Docker network.
- "--p 443:443" and "-p 80:80" map the container ports to the host machine ports.
- "--restart unless-stopped" ensures that the SWAG container restarts if it stops or crashes.
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.