Skip to content

Commit 3876283

Browse files
defguard-communitygitbook-bot
authored andcommitted
GITBOOK-108: APT repository defguard
1 parent 3c29963 commit 3876283

File tree

5 files changed

+92
-25
lines changed

5 files changed

+92
-25
lines changed

SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@
7575

7676
* [Overview](deployment-strategies/setting-up-your-instance.md)
7777
* [Hardware, OS, network and firewall recommendations](deployment-strategies/hardware-os-network-and-firewall-recommendations.md)
78-
* [Standalone package based installation](deployment-strategies/standalone-package-based-installation.md)
78+
* [Standalone package based installation](deployment-strategies/standalone-package-based-installation/README.md)
79+
* [Defguard APT repository](deployment-strategies/standalone-package-based-installation/defguard-apt-repository.md)
7980
* [Docker Compose](deployment-strategies/docker-compose.md)
8081
* [Kubernetes](deployment-strategies/kubernetes.md)
8182
* [Terraform](deployment-strategies/terraform.md)

deployment-strategies/gateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Also, if core has a custom SSL CA to secure gRPC communication, [you need the CA
4444

4545
Proceed with deploying your Gateway service using the selected [deployment strategy](setting-up-your-instance.md#choose-your-deployment-strategy):
4646

47-
* [package based](standalone-package-based-installation.md#gateway-1)
47+
* [package based](standalone-package-based-installation/#gateway-1)
4848
* [Docker Compose](docker-compose.md#deploying-gateway-service)
4949
* [Kubernetes](kubernetes.md#vpn-gateway-service)
5050
* [Terraform](terraform.md#gateway-module)

deployment-strategies/setting-up-your-instance.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ After obtaining the token, proceed with deploying the Gateway service. During it
2626
{% stepper %}
2727
{% step %}
2828
#### Deploy Defguard Core service.
29-
30-
3129
{% endstep %}
3230

3331
{% step %}
@@ -38,21 +36,19 @@ More on that [here](gateway.md).
3836

3937
{% step %}
4038
#### Deploy Gateway configured with the token.
41-
42-
4339
{% endstep %}
4440
{% endstepper %}
4541

4642
## Choose your deployment strategy
4743

48-
| Strategy name | Difficulty | Production readiness | Purpose |
49-
| --------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------- |
50-
| [One-line script](../getting-started/one-line-install.md) | :green\_circle: Easy, single command installation | :x: Doesn't follow the [recommendations](hardware-os-network-and-firewall-recommendations.md) | For testing purposes only |
51-
| [Standalone packages](standalone-package-based-installation.md) | :green\_circle: Easy, using apt and dpkg | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Small to medium deployment |
52-
| [Docker Compose](docker-compose.md) | :yellow\_circle: Medium, Docker knowledge required | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Small to medium deployment |
53-
| [Kubernetes](kubernetes.md) | :red\_circle: Advanced, requires a k8s cluster and administrator | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Large or enterprise deployments |
54-
| [Terraform](terraform.md) | :red\_circle: Advanced, requires an AWS account and knowledge | :white\_check\_mark: | Large or enterprise deployments |
55-
| [AMI and AWS CloudFormation](amis-and-aws-cloudformation.md) | :red\_circle: Advanced, requires an AWS account and knowledge | :white\_check\_mark: | Large or enterprise deployments |
44+
| Strategy name | Difficulty | Production readiness | Purpose |
45+
| ------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------- |
46+
| [One-line script](../getting-started/one-line-install.md) | :green\_circle: Easy, single command installation | :x: Doesn't follow the [recommendations](hardware-os-network-and-firewall-recommendations.md) | For testing purposes only |
47+
| [Standalone packages](standalone-package-based-installation/) | :green\_circle: Easy, using apt and dpkg | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Small to medium deployment |
48+
| [Docker Compose](docker-compose.md) | :yellow\_circle: Medium, Docker knowledge required | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Small to medium deployment |
49+
| [Kubernetes](kubernetes.md) | :red\_circle: Advanced, requires a k8s cluster and administrator | :white\_check\_mark: If you followed the [recommendations](hardware-os-network-and-firewall-recommendations.md) | Large or enterprise deployments |
50+
| [Terraform](terraform.md) | :red\_circle: Advanced, requires an AWS account and knowledge | :white\_check\_mark: | Large or enterprise deployments |
51+
| [AMI and AWS CloudFormation](amis-and-aws-cloudformation.md) | :red\_circle: Advanced, requires an AWS account and knowledge | :white\_check\_mark: | Large or enterprise deployments |
5652

5753
## Configure to your needs
5854

deployment-strategies/standalone-package-based-installation.md renamed to deployment-strategies/standalone-package-based-installation/README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ This guide will walk you through the process of installing and running Defguard
77
We will cover system requirements, additional dependencies, installation steps, and examples of configuration files and step by step running all services. In this example we will use NGINX for a web server (proxy) exposing and securing web based services.
88

99
{% hint style="info" %}
10-
Make sure you understand [Defguard's architecture](../in-depth/architecture/), especially the division into the main components: Core, Proxy, Gateway.
10+
Make sure you understand [Defguard's architecture](../../in-depth/architecture/), especially the division into the main components: Core, Proxy, Gateway.
1111
{% endhint %}
1212

1313
{% hint style="warning" %}
14-
This is a simple guide installing all components on a single server. For production make sure your infrastructure is prepared by following our [recommendations](hardware-os-network-and-firewall-recommendations.md).
14+
This is a simple guide installing all components on a single server. For production make sure your infrastructure is prepared by following our [recommendations](../hardware-os-network-and-firewall-recommendations.md).
1515
{% endhint %}
1616

1717
## System Requirements
@@ -25,7 +25,7 @@ Before proceeding with the installation, ensure your system meets the following
2525
* Administrative (sudo) privileges.
2626
* A server with a public IP address (and you know what that IP address is and to which interface it's assigned) - in this example we use: 185.33.37.51.
2727
* You have a domain name and know how to assign IP and manage subdomains, in our example: Defguard main url will be _my-server.defguard.net_ (and the subdomain is pointed to 185.33.37.51).
28-
* Defguard [enrollment service](https://defguard.gitbook.io/defguard/help/enrollment) (run by proxy) that will enable [remote onboarding, enrollment](https://defguard.gitbook.io/defguard/help/enrollment) and [easy configuration for our Desktop Clients (by adding Defguard instances)](../using-defguard-for-end-users/desktop-client/instance-configuration.md#adding-instance) with instance URL and one simple token - in this tutorial we use: _enroll.defguard.net_ (this subdomain also points to 185.33.37.51).
28+
* Defguard [enrollment service](https://defguard.gitbook.io/defguard/help/enrollment) (run by proxy) that will enable [remote onboarding, enrollment](https://defguard.gitbook.io/defguard/help/enrollment) and [easy configuration for our Desktop Clients (by adding Defguard instances)](../../using-defguard-for-end-users/desktop-client/instance-configuration.md#adding-instance) with instance URL and one simple token - in this tutorial we use: _enroll.defguard.net_ (this subdomain also points to 185.33.37.51).
2929
* If you have a **firewall**, we assume you have **open port 443** in order to expose both Defguard and enrollment service, but also to automatically issue for these domains SSL Certificates. Port 444 (used for internal GRPC communication) **should not be exposed public.**
3030
* System clock is synchronized using Network Time Protocol (NTP). This is important for time-based one-time password (TOTP) codes.
3131

@@ -61,6 +61,10 @@ defguard=# exit
6161

6262
## Installing packages
6363

64+
{% hint style="info" %}
65+
Defguard also have public APT repository, if you want know how to set it up, follow [this guide](defguard-apt-repository.md).
66+
{% endhint %}
67+
6468
### Core
6569

6670
You can find the URL to your package from the releases of the Core component on [GitHub](https://github.com/DefGuard/defguard/releases).
@@ -183,6 +187,8 @@ Example:
183187
```
184188
# on Debian/Ubuntu
185189
sudo dpkg -i <path_to_package>/defguard-proxy-X.Y.Z-x86_64-unknown-linux-gnu.deb
190+
# if you added apt repository
191+
sudo apt install defguard-proxy
186192
187193
# on Fedora/Red Hat Linux/SUSE
188194
sudo rpm -i <path_to_rpm_package>/defguard-proxy-X.Y.Z-x86_64-unknown-linux-gnu.rpm
@@ -264,9 +270,9 @@ DEFGUARD_DB_PASSWORD="defguard"
264270
DATABASE_URL="postgresql://defguard:defguard@localhost/defguard"
265271
```
266272

267-
**If you have configured your postgres with different names than in** [**PostgreSQL guide**](standalone-package-based-installation.md#postgresql)**, you can change it in DB configuration part. LDAP configuration is not part of this tutorial, you can also commented those lines.**
273+
**If you have configured your postgres with different names than in** [**PostgreSQL guide**](./#postgresql)**, you can change it in DB configuration part. LDAP configuration is not part of this tutorial, you can also commented those lines.**
268274

269-
**We will back to this configuration to connect Defguard core with proxy in the** [**Run proxy**](standalone-package-based-installation.md#run-proxy) **section. For now `DEFGUARD_PROXY_URL` is commented.**
275+
**We will back to this configuration to connect Defguard core with proxy in the** [**Run proxy**](./#run-proxy) **section. For now `DEFGUARD_PROXY_URL` is commented.**
270276

271277
After changes, you can simply enable and start your Defguard core service:
272278

@@ -302,7 +308,7 @@ To run gateway, we should do two things:
302308

303309
#### Setup location for gateway
304310

305-
Follow [this guide](gateway.md) for setting up the location in Defguard Core web interface. You should leave the guide with a token for your new Gateway instance and use it in the following configuration.
311+
Follow [this guide](../gateway.md) for setting up the location in Defguard Core web interface. You should leave the guide with a token for your new Gateway instance and use it in the following configuration.
306312

307313
#### Create config file
308314

@@ -403,7 +409,7 @@ On the other side, core service should print those informations:
403409

404410
### Proxy
405411

406-
To run proxy service (for [remote onboarding & enrollment](../using-defguard-for-end-users/enrollment/)), we can do it by:
412+
To run proxy service (for [remote onboarding & enrollment](../../using-defguard-for-end-users/enrollment/)), we can do it by:
407413

408414
```
409415
# on systems with systemd (like Debian, Ubuntu, Fedora/Red Hat Linux/SUSE)
@@ -430,7 +436,7 @@ Check the logs afterwards. Should look like this:
430436

431437
The reverse proxy acts as an intermediary between users and Defguard services, handling HTTPS requests, routing internal gRPC communication, and ensuring encrypted connections between all components.
432438

433-
Follow our additional guide on [configuring reverse proxy for for Core and Proxy service](reverse-proxy-configuration-using-nginx.md). After having the reverse proxy configured and running you can continue with this guide.
439+
Follow our additional guide on [configuring reverse proxy for for Core and Proxy service](../reverse-proxy-configuration-using-nginx.md). After having the reverse proxy configured and running you can continue with this guide.
434440

435441
### Enabling Proxy service in the Core
436442

@@ -504,7 +510,7 @@ systemctl restart defguard.service
504510
Now you have full working Defguard services 🥳
505511
{% endhint %}
506512

507-
You can [configure your desktop client using the enrollment](../using-defguard-for-end-users/desktop-client/instance-configuration.md#adding-instance) service and use your VPN.
513+
You can [configure your desktop client using the enrollment](../../using-defguard-for-end-users/desktop-client/instance-configuration.md#adding-instance) service and use your VPN.
508514

509515
If you would like to use the feature in the desktop client to route **All traffic** through the VPN please configure your firewall to enable Internet access through your VPN - [here you can find exaples how to do it](https://defguard.gitbook.io/defguard/tutorials/step-by-step-setting-up-a-vpn-server#enabling-to-access-internet-through-your-vpn).
510516

@@ -523,7 +529,7 @@ After the installation please make sure that **only the following ports are open
523529
* 50055
524530
{% endhint %}
525531

526-
Also this setup provides only communication encryption between Defguard components, if you additionally like for core/proxy and gateway to have authorization - [please setup a custom SSL CA](grpc-ssl-communication.md#custom-ssl-ca-and-certificates).
532+
Also this setup provides only communication encryption between Defguard components, if you additionally like for core/proxy and gateway to have authorization - [please setup a custom SSL CA](../grpc-ssl-communication.md#custom-ssl-ca-and-certificates).
527533

528534
## Upgrading packages
529535

@@ -541,7 +547,7 @@ Also this setup provides only communication encryption between Defguard componen
541547
# or Proxy package
542548
pkg delete defguard-proxy
543549
```
544-
2. Install a newer version (as described [above](standalone-package-based-installation.md#installing-packages)).
550+
2. Install a newer version (as described [above](./#installing-packages)).
545551
3. Restart the service.
546552

547553
```bash
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Defguard APT repository
2+
3+
4+
5+
### Adding Defguard APT repository
6+
7+
To add Defguard APT repository, run following commands in your terminal:
8+
9+
```bash
10+
sudo apt update
11+
sudo apt install -y ca-certificates curl
12+
#Add official Defguard public GPG key
13+
sudo install -m 0755 -d /etc/apt/keyrings
14+
sudo curl -fsSL https://apt.defguard.net/defguard.asc -o /etc/apt/keyrings/defguard.asc
15+
sudo chmod a+r /etc/apt/keyrings/defguard
16+
17+
#Add APT repository
18+
echo \
19+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/defguard.asc] https://apt.defguard.net/ trixie release " | \
20+
sudo tee /etc/apt/sources.list.d/defguard.list > /dev/null
21+
22+
sudo apt update
23+
```
24+
25+
Afterward running these commands, you can install and update Defguard via APT.&#x20;
26+
27+
After new release, simply use `sudo apt update` to update repository.
28+
29+
### Using pre-release builds
30+
31+
Defguard has two separate components on one APT repository, **release** and **pre-release.** If you want to install packages from pre-release, simply change `release` to `pre-release` in the installation steps described above, or run the following line.
32+
33+
```sh
34+
echo \
35+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/defguard.asc] https://apt.defguard.net/ trixie pre-release " | \
36+
sudo tee /etc/apt/sources.list.d/defguard.list > /dev/null
37+
sudo apt update
38+
```
39+
40+
### Installing packages
41+
42+
Defguard Core:
43+
44+
```sh
45+
sudo apt install defguard
46+
```
47+
48+
Defguard Proxy:
49+
50+
```sh
51+
sudo apt install defguard-proxy
52+
```
53+
54+
Defguard Gateway:
55+
56+
```sh
57+
sudo apt install defguard-gateway
58+
```
59+
60+
Defguard Client:
61+
62+
```sh
63+
sudo apt install defguard-client
64+
```

0 commit comments

Comments
 (0)