How to Install SWAG on EndeavourOS Latest
SWAG, or Secure Web Application Gateway, is a popular web server and reverse proxy solution that helps to securely expose your web applications to the internet. This tutorial will guide you through the installation process of SWAG on EndeavourOS Latest.
Prerequisites
Before getting started, you will need:
- A running instance of EndeavourOS Latest
- Docker and Docker Compose are installed on your system
- A domain name for your web applications which should be pointed to your server IP address
Steps for Installing SWAG
Begin by updating the package lists on your system:
sudo pacman -SyyInstall Git if not already installed by running:
sudo pacman -S gitClone the SWAG repository from GitHub to your system:
git clone https://github.com/linuxserver/docker-swag.gitChange the working directory to the cloned repository:
cd docker-swagNow create a .env file to define some environment variables which will be used in the docker-compose.yml file:
cp .env.sample .env nano .envReplace the following variables with your details:
# Your email address [email protected] # Your domain name URL=example.comNext, start the SWAG container:
docker-compose up -dThis may take a few minutes to complete depending on your internet connection.
Verify that the SWAG container is running by checking the container logs:
docker-compose logs -fOnce the container has successfully started, you should see output similar to the following:
Generating DH parameters, 2048 bit long safe prime, generator 2 This may take a long time ... Created DHPARAMS MAXMIND DATABASE CHECK: Database is FTPing...done. Starting nginx ... done Starting swag ... done
How to Configure SWAG
After the installation, you can configure SWAG by modifying the docker-compose.yml file located in the SWAG installation directory. For example, you can add additional web applications by adding new services to the docker-compose file.
To update the configuration of an existing web application, you can modify the respective webroot and proxy_pass directives in the nginx.conf file which can be found in the config/nginx subdirectory.
Conclusion
In this tutorial, we have shown you how to install SWAG on EndeavourOS Latest. You are now ready to start serving your web applications securely with SWAG. Enjoy!