155 lines
5.7 KiB
Markdown
155 lines
5.7 KiB
Markdown
---
|
|
title: DP-Salad Setup
|
|
---
|
|
|
|
# DP-Setup
|
|
|
|
This guide demonstrates the installing of the DP-Salad stack:
|
|
|
|
## Debian 12 Setup :logos-debian:
|
|
|
|
Visit [Debian's download page](https://debian.org/download) to get the latest version of Debian, as of this writing, Debian 12.5.0 is the latest. This is a *netinst*, meaning that it will require an internet connection to download the OS files.
|
|
|
|
Load your Debian ISO onto a USB stick, either directly, or using Rufus/Balena Etcher to write the ISO to stick.
|
|
|
|
Plug it into whatever is becoming your server, and boot to the USB stick in your system's BIOS.
|
|
|
|
Install Debian using the ISO. Make sure that you are connected to the internet before trying to install Debian.
|
|
|
|
1. Select Graphical Installer
|
|
2. Follow the setup process up until hostname, and put in something that you will recognize when port-forwarding or tunneling.
|
|
3. Put in the domain name that you have leased as your domain name, like: "*example.com*"
|
|
4. Setup a root password. (Template uses DPSALADSTACK)
|
|
5. Setup the name for the first non-admin user. (Template uses dpsalad)
|
|
6. Setup a password for the non-admin user. (Template uses DPSALADSTACKUSER)
|
|
7. Continue the setup, and select "Guided - use entire disk" when Partitioning Disk, continue and use "All files in one partition" as the partitioning scheme.
|
|
8. Allow changes to be written to disk.
|
|
9. Continue with the installer until Software Selection. See the following points for the selections.
|
|
- Debian desktop environment (keep selected)
|
|
- GNOME (deselect)
|
|
- xfce (select)
|
|
- SSH server (select)
|
|
- standard system utilities (keep selected)
|
|
10. Continue with the installer until the reboot.
|
|
11. Once the reboot is complete, you should have a fully working Debian system!
|
|
12. If you used the template, please change the password of both the root and regular user using passwd.
|
|
|
|
## Sudo no worky :man-facepalming:
|
|
|
|
Debian had you set up a root password, but when you try using sudo, it will not let you do anything. Debian by default does not let the first user have sudo access. See why here: [Reason](https://wiki.debian.org/sudo#:~:text=Why%20sudo%3F,root.%20Some%20reasons). You will have to temporarily log in as root to fix this. Use the following commands/instructions to add your user to the sudoers file.
|
|
|
|
```markdown
|
|
1. su -
|
|
2. nano /etc/sudoers
|
|
3. Add the following to the file(no quotes): "username ALL=(ALL:ALL) ALL"
|
|
4. Exit nano using Ctrl+X and then type 'Y' and enter.
|
|
5. Restart your PC.
|
|
6. systemctl reboot
|
|
```
|
|
|
|
Once your machine restarts, you should now be able to use the sudo command.
|
|
|
|
## Disabling GUI :desktop-computer:
|
|
|
|
If you'd like to disable the GUI and work in CLI only (highly recommended, as GUI uses more resources), follow these instructions:
|
|
|
|
```markdown
|
|
1. sudo systemctl set-default multi-user.target
|
|
2. sudo reboot
|
|
```
|
|
|
|
## Updating your system :mdi-monitor:
|
|
|
|
Now time to run updates, just to guarantee the system is up-to-date. Debian uses *APT* as it's package manager of choice. Run these commands:
|
|
|
|
```markdown
|
|
1. sudo apt-get update
|
|
2. sudo apt-get upgrade
|
|
```
|
|
|
|
And now, your system is up-to-date!
|
|
|
|
## Installing the Docker :logos-docker-icon:
|
|
|
|
Next, install Docker. Follow the following instructions to install Docker:
|
|
|
|
```sh
|
|
sudo apt-get update
|
|
```
|
|
|
|
```sh
|
|
sudo apt-get install ca-certificates curl gnupg
|
|
```
|
|
|
|
```sh
|
|
sudo install -m 755 -d /etc/apt/keyrings
|
|
```
|
|
|
|
```sh
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
|
```
|
|
|
|
```sh
|
|
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
|
```
|
|
|
|
```sh
|
|
echo \
|
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
|
|
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
```
|
|
|
|
```sh
|
|
sudo apt-get update
|
|
```
|
|
|
|
```sh
|
|
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin dockercompose-plugin
|
|
```
|
|
|
|
Once this is done, you are able to move on to the next section of this guide
|
|
|
|
::: danger
|
|
If you use anything other than the *netinst* for Debian, your apt sources may be invalid. Should this be the case, there is an example of the sources needed in `/usr/share/doc/apt/examples/sources.list`. Use the following command to copy this list of default sources to restore apt to working order. `sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list`
|
|
:::
|
|
|
|
## Portainer CE Setup :simple-icons-portainer:
|
|
|
|
Time to setup Portainer, which is installed using Docker. Follow the below instructions to install Portainer onto your machine.
|
|
|
|
```sh
|
|
sudo docker volume create portainer_data
|
|
```
|
|
|
|
```sh
|
|
sudo docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
|
|
```
|
|
|
|
- Visit https://[ip-address]:9443 to log into Portainer CE.
|
|
|
|
- Change the admin username if you wish. (Don't forget it if you change it though!) [Template uses DPSALADSTACK]
|
|
|
|
- Use a good secure password (12+ characters) for the administrator password. (Don't forget this either!)
|
|
|
|
- Click "*Getting Started*" to finish setting up Portainer CE.
|
|
|
|
- If you are going to use the one-click Compose Install, make sure to create a network using the following command:
|
|
|
|
```sh
|
|
sudo docker network create [INSERT NETWORK NAME HERE]
|
|
```
|
|
|
|
::: tip
|
|
Make sure to remove the square brackets around the network name.
|
|
:::
|
|
|
|
## Some changes need to be made :wrench:
|
|
Do note that some changes need to be made before the stack installation is finished. These two commands need to be ran to make sure Redis can be deployed for the stack to function correctly.
|
|
|
|
```sh
|
|
mkdir -p /home/[USER]/appdata/redis/redis/
|
|
mkdir -p /home/[USER]/appdata/redis/redis/data/
|
|
```
|
|
|
|
That's it! You have successfully installed Debian and Portainer! :party-popper:
|