Installing SWAG on MXLinux Latest
SWAG (Secure Web Application Gateway) is an open-source and docker-based application developed and maintained by Linuxserver Community. In this tutorial, we will walk through the steps to install the SWAG docker image from Linuxserver on MXLinux Latest (v19.x).
Prerequisites
Before we start, a few prerequisites are required for the installation process:
- MXLinux Latest installed and configured
- Docker Engine installed on the system
- Docker Compose installed on the system
Step 1: Install Docker Engine
If Docker Engine is not installed on your MXLinux system, you can run the following commands in the terminal to install it:
$ sudo apt-get update
$ sudo apt-get install docker.io
Once the installation is complete, verify the Docker Engine installation by running:
$ sudo systemctl status docker
You should see the status of the Docker service as 'active (running)'.
Step 2: Install Docker Compose
Docker Compose is required to manage the SWAG container, and if it is not installed on your system, follow these steps to install it:
- Run the following command to download the Docker Compose binary:
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- After the download is complete, make the binary executable by running:
$ sudo chmod +x /usr/local/bin/docker-compose
- Verify the installation by running:
$ docker-compose --version
You should see the version of Docker Compose installed on your system.
Step 3: Clone the SWAG repository
To install the SWAG docker image, we need to clone the SWAG repository from GitHub. Here are the steps to clone the repository:
Open the terminal and navigate to the directory where you want to clone the repository.
Run the following command to clone the SWAG repository:
$ git clone https://github.com/linuxserver/docker-swag.git
Step 4: Configure SWAG
Before we can start the SWAG container, we need to configure some settings. Follow these steps to configure SWAG:
- Navigate to the docker-compose.yml file inside the docker-swag directory:
$ cd docker-swag
$ nano docker-compose.yml
- Inside the docker-compose.yml file, you will see a number of configuration options that you need to modify according to your needs. Here are some examples:
- Change the domain name (in the environment section) to your own domain name.
- Enable SSL by uncommenting the letsencrypt section.
- Add your email address in the letsencrypt section.
- Save the changes to the file by pressing 'Ctrl + X', then 'Y', and finally 'Enter'.
Step 5: Start SWAG
After the configuration is complete, we can start the SWAG container by running the following command inside the docker-swag directory:
$ docker-compose up -d
This command will download the necessary images and start the SWAG container in the background. By default, the SWAG container will listen on port 443 and redirect HTTP requests to HTTPS.
Step 6: Verify SWAG
After the container starts successfully, you can verify that it's running by running:
$ docker ps
You should see the SWAG container listed in the output.
Congratulations, you have successfully installed and configured SWAG on MXLinux Latest using Docker. You can now add your applications and services to the container for secure access over the internet.