Category: Linux

  • How to Install Arch Linux From Scratch

    In this guide, I will be showing you how to install Arch Linux from scratch. You can do this on a physical machine, but I will be doing it on a virtual machine.

    What is Arch Linux?

    Arch Linux is a minimal Linux distro that is meant for power users and advanced programmers. It does not come with a built-in installer, so we will have to install it manually.

    Downloading the ISO

    First, head to the Arch Linux downloads page, scroll down until you find the download mirrors, and then choose a link to download, preferably from your country so you get the fastest download speed.

    VM Configuration

    If you are installing Arch Linux on physical hardware and you are not using a VM to install Arch, skip this section.

    If you are on VirtualBox, there should be an Arch Linux preset. If you are on VMware, select Other Linux 5.x Kernel (64-bit).

    Giving your VM 8 GB of RAM is a lot more than needed, but if you are going to be using Arch for power-intensive tasks and don’t mind the VM taking up all your host’s RAM, go for whatever fits for you as long as it meets the system requirements of 512 MB minimum, but 2 GB recommended for streamlined daily use.

    Now, give your VM any amount of storage you feel fitting, but make sure it meets the system requirements of 1 GB minimum, but 20 GB recommended.

    If you want things to go a little faster on your Arch Linux VM, giving it two processors is recommended. One processor should be enough, though.

    If you plan on installing a desktop environment, enable 3D acceleration and give a reasonable amount of VRAM to the guest OS.

    And lastly, make sure the CD drive is set to read as the ISO you just downloaded.

    Making a Bootable USB

    If you are using a VM, skip this section.

    Use a tool like Rufus to flash the Arch Linux ISO to a flash drive. Then plug it into the system you want to install Arch Linux to. This guide does not cover dual-booting and assumes you do not have an existing OS installed on your system.

    Boot Priority Configuration

    Make sure the hard disk is the first on the boot priority list. This is not required; it just makes the final step of the installation a lot quicker.

    You can do this in the VM’s settings, the UEFI firmware settings, or the BIOS interface.

    Starting the System

    If you are on a VM, start it up. If you are on hardware, plug in the thumb drive that you flashed the ISO to and start the machine.

    You should see an Arch Linux splash screen. Whichever entry comes first in the list is likely the one that boots to Arch (the name of the entry changes, but typically goes along the lines of “Boot Arch Linux (x86_64)”). Select Boot Arch Linux, or the entry that does so, and click Enter.

    After running some tests, you should be dropped into a root Linux shell. Do not remove your thumb drive or installation media, as we have not installed Arch yet and need to do so using the thumb drive.

    Accessing the Internet

    Let’s check if we have connection to the internet by running the command below (“google.com” can be replaced with a website of your choice):

    Bash
    ping google.com

    You should see packets return. If you do, this means you have online access, which is a necessity for this installation. You can hit Control + C to stop pinging the website.

    If you are on a Virtual Machine with no internet, try making sure that you have host internet access, and then try enabling the network adapter in the VMware or VirtualBox settings.

    If you are on a physical machine without internet, try using an Ethernet cable, but below you will know how to use iwctl to connect to a Wi-Fi network.

    Using iwctl to Connect to a Wi-Fi Network

    This part of the guide should only be followed if you do not have Internet access and want to use a wireless internet connection instead of a wired one.

    Run the command below to open the iNet Wireless Daemon CTL.

    Bash
    iwctl
    Expected Output
    [iwd]# 

    Now, you can list the wireless adapters using the command below.

    Bash
    device list

    You should see a device called wlan0. It is best to go forward using that one, but you can select another wireless adapter if you know what you are doing. If you do not have that device, then you do not have a wireless adapter plugged into the computer, the device is connected but under a different name (which is unlikely), or the computer does not recognize it.

    Use the command below to list all the wireless networks found using that device. You can replace wlan0 with the adapter you chose earlier.

    Bash
    station wlan0 get-networks

    You should see a list of networks. Take note of the network’s SSID you want to connect to. Then, you can run the command below to connect to the wireless network, replacing “WirelessNet” with the SSID of your wireless network and wlan0 with the wireless adapter you want to connect to the network using.

    Bash
    station wlan0 connect WirelessNet

    After typing in the Wi-Fi password (if needed), you may now connect to the network. You can test your connection by using ping google.com and waiting for packets to return. If none return, then you might have done something incorrectly when setting up the network.

    Setting NTP Time

    Now that we have our network up and running, we can enable network time using the command below:

    Bash
    timedatectl set-ntp true

    Partitioning

    Now comes the tricky part. We have to partition our drives manually, so make sure to follow my steps carefully.

    Run the below command to get a summary of all the partitions on your drive.

    Bash
    lsblk

    Make sure you choose the right disk to partition, as choosing the wrong one will destroy all of your data. Run the below command to set up partitioning, replacing /dev/sda with the name of the disk you want to format and install Arch Linux on.

    As for the label type, it depends what your needs are. If you are installing to a new physical system with a disk size larger than 2TB, select gpt and hit Enter. If you either don’t have a physical system to install Arch to or are installing Arch to a disk smaller than 2TB, use dos. Now, at the menu with drives listed, select the free space and click New. When asked for your partition size, enter the amount needed for your bootloader. If you will be using the GRUB bootloader, enter 128M and hit Enter. If not, specify the amount needed for your bootloader.

    Now, select the newly created partition and hit B to make the selected drive bootable.

    Select the free space, and click New. The size should automatically default to the remaining storage on your drive. Make the partition fill up the rest of the drive, and click Enter to create the partition. You should not make this partition bootable.

    Many people prefer creating home and swap partitions but these are mostly considered redundant nowdays.

    Select Write and click Enter, then select Quit and click Enter.

    There is only one problem left to solve now – the drives are not in the format of ext4. To solve this, run the commands below, replacing /dev/sda1 and /dev/sda2 with the names your newly created boot and OS partitions.

    Bash
    mkfs.ext4 /dev/sda1
    mkfs.ext4 /dev/sda2

    Mounting our Partitions

    Now that we are done with arguably the hardest part of Arch installation, we need to mount our drives, which is where the preparation ends and the actual installation starts.

    To begin, lets mount our root partition (the partition that is not bootable, /dev/sda2 in my case) to a mount point (this can be anything you want, but traditionally this has always been /mnt. I will be using /mnt, as I do not see any reason to stray from tradition in my case). We can do this using the command below.

    Bash
    mount /dev/sda2 /mnt

    In our mount point, let’s create a folder called boot to mount our other drive to.

    Bash
    mkdir /mnt/boot

    Now, let’s mount our boot partition (the one that we flagged bootable earlier, /dev/sda1 in my case) to the folder we just created.

    Bash
    mount /dev/sda1 /mnt/boot

    To see if we did everything correctly, we can run the command below.

    Bash
    lsblk

    In the output, you should be able to see partitions under the drive /dev/sda and their respective mount points.

    Installing Arch Using pacstrap

    Now, we can begin installing system files to Arch.

    We can use pacstrap to install Arch Linux and some other packages we want pacstrap to bundle in with our Arch installation. Replace /mnt with the mount point you mounted your root drive to, and vim with some other text editor that you prefer and some other pre-installed packages you want on Arch.

    Bash
    pacstrap /mnt base base-devel linux linux-firmware vim

    Below ae explanations of some of the packages:

    • Base: This package contains basic tools that you would want no matter which Linux distribution you are installing.
    • Base-Devel: This contains developer tools such as compilers, which are needed for some Linux components.
    • Linux: This is the core Linux kernel that runs everything behind the scenes.
    • Linux-Firmware: This contains firmware that makes Arch compatible with common hardware
    • Vim: This can be replaced with any text editor. There is some text editing we are going to have to do, so we need a text editor.

    Once pacstrap exits, we can generate an fstab file that lists all the drives Linux could try booting from.

    Generating our FSTab File

    This is extremely easy to do. Run the command below, replacing /mnt with the mount point you specified earlier.

    Bash
    genfstab -U /mnt >> /mnt/etc/fstab

    What the command should do is write a FSTab file to the drives. The -U flag makes the file reference drives by UUID instead of drive name. This is good because drive names may change in the future, which could mess up your boot configuration if you don’t reference drives by UUID, as UUID never changes.

    Jumping to our Arch Installation

    It is finally time to change from our installation medium to our disk. Do not remove your installation medium until the end of this guide. You might need it if something breaks.

    Bash
    arch-chroot /mnt /bin/bash

    After this command, do not reboot yet. We still have to install our boot manager.

    Installing Basic Components

    Now that we are in Arch, we have access to the Pacman package manager. We can use it to install basic components like a network manager for accessing the internet, and a boot manager so we can boot into the system. I will be installing GRUB as a boot manager, but you can install something else.

    Use the command below to install these components.

    Bash
    pacman -S networkmanager grub

    Configuring the Network Manager to Run on Startup

    If we want internet at boot, we are going to have to enable NetworkManager’s system service. we can do this using the command below.

    Bash
    systemctl enable NetworkManager

    Configuring the GRUB Boot Manager

    Now, we have to configure what our system boots using. When we ran the Pacman command, we downloaded GRUB, but we did not install or configure it. Let’s install GRUB using the command below, replacing /dev/sda with whatever drive you are using to install Arch. We are not going to be using /dev/sda1 or /dev/sda2 because it is critical that you install it to the drive, not the drive partition.

    Bash
    grub-install /dev/sda

    Now, we can make a GRUB configuration file using the command below.

    Bash
    grub-mkconfig -o /boot/grub/grub.cfg

    Take a look at the output and make sure that it says both an initrd image and a Linux image were found. If it does not find these images, the most likely cause is incorrectly installing the Linux kernel using pacstrap.

    Setting a Password

    Now, run the command below to create a password for your root user.

    Bash
    passwd

    Configuring Locales and Timezones

    Use the command below to enter the locale configuration file, replacing vim with whatever text editor you installed earlier.

    Bash
    vim /etc/locale.gen

    Now, use the arrow keys or the scroll wheel to scroll down to the locale you want to use. I will be using United States English, so I will scroll down to en_US and uncomment (remove the # before) both the UTF and ISO formats. If you are using Vim, you might have to hit the I key on your keyboard before you can actually type anything.

    Write the file and exit your text editor. To write and exit Vim, we can hit the Escape key on our keyboard and type :wq.

    Now that we have our locales configured, we have to apply the changes by generating the locales. We can do this using the command below.

    Bash
    locale-gen

    Now, we also have to create a file called locale.conf to define our language in. Use the command below, once again replacing vim with your desired text editor.

    Bash
    vim /etc/locale.conf

    In the file, type LANG=en-US.UTF-8, once again replacing en-US with whatever locale you are using. Exit Vim.

    Now that we have the timezones prepared, we have to link them to make our system clock show the right timezone. Type ln -sf /usr/share/zoneinfo and click Tab. This will list all the broadest timezones. Keep making the directories more specific, hitting Tab to see the available options every time, and after you are done typing a city, hit Space and type /etc/localtime.

    Setting Our Hostname

    Now, we can set our hostname. This is the name that the Arch machine will use to communicate with other devices over your network. By default, your hostname is archiso. If you are happy with that and don’t want to change it, you can skip this section.

    Use your prefered text editor to create /etc/hostname. Do not include a file extension. Type whatever you want your system hostname to be, and exit.

    Unmounting Our Disk

    Now, we can exit our chroot jail by using the command below.

    Bash
    exit

    Now would be a good time to check and make sure your hard drive is first boot priority. Make sure that when you return, you are in your installation medium and not in the actual Arch installation.

    Unmount our Arch installation with the command below, replacing /mnt with the mount point you specified earlier.

    Bash
    umount -R /mnt

    Now, we can boot into our new installation of Arch Linux using the command below. Once you have booted in, you may remove the installation medium.

    Bash
    reboot
  • How to disconnect WiFi devices on another network using the ESP8266

    There is a common WiFi attack that can disconnect any device on the network you are currently on. It also works on networks that you are not currently on.

    How it works

    There is a protocol in WPA2 that lets you disconnect a device safely from a network. However, these packets are not encrypted, so anyone with a WiFi-enabled device (like the ESP8266) can fake these packets.

    Installing the software

    First, go to the ESP8266 deauther page and download the latest release and download the file esp8266_deauther_[VERSION]_NODEMCU.bin.

    Next, download the ESP8266 Flasher and run the utility. Flash the binary file (the .bin you downloaded) at 0x00000. Click Flash and wait till it completes.

    Running attacks

    On a device, connect to the Wi-Fi network named pwned and enter the password deauther. Next, go to the IP address 192.168.4.1 and click I have read and understood the risks and choose a target network. Under the Attacks tab, begin the attack Deauth.

    A note on WPA3

    WPA3, which was passed as an official WiFi protocol, encrypts these packets so hackers cannot abuse them. However, some WiFi routers still use WPA2, so this attack will still work sometimes.

  • How to make permanent bash aliases and bash functions

    In the last post, I covered how to make bash aliases. However, creating bash aliases with the alias command only lets you create bash aliases for the current session. For example, if I were to use alias hi="echo hi" to make a bash alias that connects hi with the command echo hi, and then exited the terminal session, all the bash aliases would reset. However, there is a way to make them permanent.

    Creating Permanent Bash aliases

    To make Bash aliases permanent, you will need to add lines to the ~/.bash_profile or ~/.bashrc file. Once you find out that file, open it with the text editor of your choice. I prefer nano.

    Make sure to run the below command after you are done modifying those files:

    BASH SHELL
    source ~/.bash_profile

    The below commands are how you get into the file.

    BASH SHELL
    cd ~
    nano .bashrc

    Then add your aliases.

    BASH CONFIGURATION
    # Aliases
    # alias alias_name="command_to_run"
    
    
    # If you are new to the shell, note that the Linux system ignores lines that start with '#' so this line does not mean anything to Linux
    
    # Long format list
    alias ll="ls -la"
    
    # Print my public IP
    alias myip="curl ipinfo.io/ip"
    
    # That 'hi' example from earlier
    alias hi="echo hi"

    Now when you reboot your Linux system, the Bash aliases should still work.

    Bash aliases with command arguments (Bash functions)

    Sometimes you may need to create a Bash alias that will change depending on certain values or will accept arguments. The syntax for Bash functions is relatively easy. They can be declared in two separate formats. It is preferred to declare functions using the ~/.bashrc file.

    TIP: If you want your .bashrc file to be more modular, you can store your aliases in a separate folder. Some distributions of Linux like Ubuntu or Debian include a separate .bash_aliases file.

    The syntax is below. Way 1 is the preferred way and the most used one.

    Way 1 (Multi-Line):

    BASH CONFIGURATION
    function_name () {
      commandsToRun
    }

    Way 1 (Single-Line):

    BASH CONFIGURATION
    function_name () { commandsToRun; }

    Way 2 uses the keyword of function, and then the function name, and after that the commands to run. The code below demonstrates way 2 (multi-line):

    BASH CONFIGURATION
    function function_name {
      commandsToRun
    }
    

    Way 2 (Single-Line):

    BASH CONFIGURATION
    function function_name { commandsToRun; }

    A few things that are nice to know:

    • The commands that the function will run are between the curly braces ({}). This is called the body of the function. The curly braces must be separated from the body by newlines or spaces. In this case, function A {commandsToRun;} or A () {commandsToRun;} will not work, but something like function A { commandsToRun; } or A () { commandsToRun; } which has spaces separating the body of the function from the function data will.
    • Simply defining a function will not execute it. If you want to invoke or execute a bash function simply use the name of the function. The body of the function is executed when you invoke it in the shell script.
    • You must define the function before calling or executing it.

    You can pass any number of arguments in a function. If you want to call a Bash function right after the function’s name, separated by a space. The passed parameters can be referenced with $1, $2, $3, $4, etc., corresponding to the position of the argument after the name of the function when it is executed. Below is a simple bash function that will create a directory and then navigate into it:

    BASH/SH
    mkcd () {
      mkdir -p -- "$1" && cd -p -- "$1"
    }

    Same as aliases, make sure to add the Bash functions in the ~/.bashrc file and run source ~/.bash_profile to make the changes take effect.

    Now instead of having to make a directory using mkdir and then move into that directory using cd, you can simply use our mkcd function:

    BASH SHELL
    mkcd testDirectory

    A few things that you need to know:

    • The -- makes sure that Linux does not get confused and parse the folder name as an argument. If you have a folder that starts with -, Linux might parse it as an argument.
    • The && ensures that the second command runs only if the first one is successful.

    Final Note

    By now you should have a good understanding of how Bash aliases and functions work. This should help you be more productive on the command line.

    If you have any questions or feedback, feel free to leave a comment on this post.

  • How to Create Bash Aliases in Linux, and How They Work

    If you are like me, you will often find yourself typing long, bulky, and hard-to-remember commands in the Linux terminal, and if not, I will almost always find myself searching the bash history for a long command I typed earlier. If you are also like me, this is where bash aliases come in handy. Bash aliases are like shortcuts, short, quick replacements for long, bulky commands. For example, you can use rmopwrt instead of opkg remove --force-remove --force-removal-of-dependent-packages ppp ppp-mod-pppoe odhcpd-ipv6only dnsmasq hostapd-common luci luci-ssl-openssl luci-base lua luci-app-firewall luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap uhttpd uhttpd-mod-ubus. In this post, I will show you how to create bash aliases in Linux, so you can save time on the command line, and be more productive.

    Creating Bash Aliases

    Creating bash aliases is very easy and straightforward. The basic command is as follows:

    BASH SHELL
    
    alias whatever_you_want_your_alias_to_be_called="command_to_run"

    However, like always, make sure not to use spaces in the name, else Linux will think it is a command argument, and the alias command does not take any. When you create an alias, you type “alias”, followed by your alias name, an equal sign without spaces, and then, without spaces, in quotes, what command the alias should run. In the case above, running whatever_you_want_your_alias_to_be_called will do the same thing as running command_to_run.

    Let us try another example.

    BASH SHELL
    
    alias myip="hostname -I"

    When you run myip, you will get the same output as running hostname -I.

    Done!

  • How to turn your Raspberry Pi into a WiFi router using OpenWrt

    How to turn your Raspberry Pi into a WiFi router using OpenWrt

    LightDarkDarkDark

    In this guide, I will be turning a Raspberry Pi into an OpenWrt router. This is good for travel, and it can connect to VPN servers to give you secure VPN internet.

    What will you need?

    Here is a list of items you will need:

    Step 1: Bake the Pi

    First, we need to install OpenWrt on the board. To do that, put the MicroSD card into the MicroSD card reader, then plug the MicroSD card reader into the computer.

    Now install the Raspberry Pi Imager.

    Once that is done, download the proper firmware from this site. Then, once you have the Raspberry Pi Imager open, select, click “Choose OS”. Then scroll down and click “Use Custom”, then select the location of the firmware that you downloaded from the OpenWrt Wiki.

    Click “Select Drive”, then click the drive of the SD card reader.

    Step 2: Connect to OpenWrt via SSH

    Now, plug the ethernet cable into your Raspberry Pi, then plug the other end into your computer. Open Command Prompt, then run:

    BATCH
    
    ssh root@192.168.1.1

    On the fingerprint prompt, type “yes”.

    Step 3: Setting a password

    When we used SSH to log in to the OpenWrt session, notice that it did not prompt us for a password. Super insecure. To set one, run the command. This is also how you change the password on any Linux device:

    ASH SHELL
    
    passwd root

    Follow the prompts.

    Step 4: Backing up all of the config files

    Run all these commands, in order:

    ASH SHELL
    
    cd /etc/config/
    cp firewall firewall.bk
    cp wireless wireless.bk
    cp dhcp dhcp.bk
    cp network network.bk

    Step 5: Netwok Configuration Settings

    Run these commands. I hooked mine up to the LAN interface, if you want to use Wi-Fi, follow the official documentation. These will configure OpenWrt to connect to your network.

    ASH SHELL
    
    uci set network.lan.ipaddr=192.168.2.2
    uci set network.lan.gateway=192.168.2.1
    uci set network.lan.dns=192.168.2.1
    
    uci commit
    service network restart

    Step 6: Partitioning

    Create a partition to store data. We will install fdisk and use it:

    opkg update
    opkg install fdisk
    fdisk /dev/mmcblk0

    To create two partitions (one for /home and one for /srv), use the following fdisk commands.

    • p to print the current partition table.
    • n then e to create an extended partition.
    • n then l to create the first partition. When asked for the last sector, type +2G to make it 2GB large.
    • n then l to create the second partition. When asked for the last sector, leave empty to fill the remaining space.
    • w to write the partition table.

    And reboot your Raspberry Pi!

    Step 7: Creating a filesystem on our partitions

    Run these commands:

    ASH SHELL
    
    mkfs.ext4 /dev/mmcblk0p5
    mkfs.ext4 /dev/mmcblk0p6

    Now we can mount the first partition at /home and the second at /srv. Both are on a flash SD card, the noatime flag is important.

    ASH SHELL
    
    opkg update
    opkg install block-mount
    block detect | uci import fstab
    uci set fstab.@mount[2].target=/home
    uci set fstab.@mount[2].enabled=1
    uci set fstab.@mount[2].options=noatime
    uci set fstab.@mount[3].target=/srv
    uci set fstab.@mount[3].enabled=1
    uci set fstab.@mount[3].options=noatime
    uci commit

    Create the srv mount point, as the other one already exists.

    ASH SHELL
    
    mkdir -p /srv

    Mount both partitions.

    ASH SHELL
    
    block mount

    Step 8: Set the hostname

    ASH SHELL
    
    uci set system.@system[0].hostname='thetechmaker-good.hi.testing'
    uci commit

    Step 9: Remove unused packages

    OpenWrt was originally a Linux distribution for routers, so it might come with useless networking software you’ve never heard of. You can remove this with the following commands:

    ASH SHELL
    
    opkg remove --force-remove --force-removal-of-dependent-packages ppp ppp-mod-pppoe odhcpd-ipv6only dnsmasq hostapd-common luci luci-ssl-openssl luci-base lua luci-app-firewall luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap uhttpd uhttpd-mod-ubus
    

    Step 10: Done!

  • How to set up a Static IP to the Raspberry Pi

    How to set up a Static IP to the Raspberry Pi

    LightLightDarkDark

    If you don’t want the router to keep assigning a new IP to the pi every now and then, then set a static IP. Image Credit

    How to do it

    1: First, Check if a service is enabled:

    BASH
    
    sudo service dhcpcd status

    Sign up for our newsletter!

    1.1: If it is, you are good to go. If not, run the commands:

    BASH
    
    sudo service dhcpcd start
    sudo systemctl enable dhcpcd

    2: Run command:

    BASH
    
    sudo nano /etc/dhcpcd.conf

    3: Uncomment (remove the # that is at the beginning) the following lines:

    CONFIG
    
    interface eth0
    static ip_address=192.168.0.4/24
    static routers=192.168.0.1
    static domain_name_servers=192.168.0.1

    3: Change the line static ip-address=192.168.0.4/24 to what you want your new static IP to be. static ip_address= proceeds, /24 follows. It should look like this. NOTE: Your IP has to start with 192.168 for this to work:

    CONFIG
    
    static ip-address=[Your IP]/24

    4: Press CTRL+ALT+X

    5: Hit Y

    6: Reboot:

    BASH
    
    sudo reboot

    7: Now, on a Windows machine on the same network, open up Command Prompt and type the batch code. NOTE: THE -t FLAG IS NOT REQUIRED:

    WINDOWS BATCH
    
    ping [YOUR PI'S NEW STATIC IP] -t

    8: Now wait for a response to test if it’s working

    DONE

  • Block Ads using AdGuard Home on the Pi

    Block Ads using AdGuard Home on the Pi

    LightLightDarkDark

    If you want to block ads, then AdGuard Home is for you. AdGuard Home is an ad-blocker. But this ad-blocker would work network-wide.

    We recommend a static IP for this tutorial

    Items you will need

    • A Raspberry Pi
    • It’s peripherals

    Sign up for our newsletter!

    Installing AdGuard

    This will show you how to install it.

    This is simple because we are downloading a compiled version of it.

    1: Upgrade all our apps and some of the system:

    BASH
    
    sudo apt update
    sudo apt full-upgrade

    2: Download a compressed version of it:

    BASH
    
    wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_arm.tar.gz

    3: Create an extracted version of this that we can actually work with:

    BASH
    
    tar xvf AdGuardHome_linux_arm.tar.gz

    4: We don’t need the compressed version of this because we already have an extracted version that we are going to work with. Since we are can’t (and not going to) work with this one, lets delete it:

    BASH
    
    rm AdGuardHome_linux_arm.tar.gz

    5: Lets move in to our newly downloaded and extracted software:

    BASH
    
    cd AdGuardHome

    6: Finally, we can install AdGuard on our system as a Startup Service:

    BASH
    
    sudo ./AdGuardHome -s install

    7: Once installation completes, you should see a message in your command line.

    Accessing AdGuard via the web portal / Setting it up

    For this stage, you will need you and your Pi to be on the same network.

    1: Navigate to the portal. Go to your Pi’s IP address (to find out what it is, run hostname -I OR sudo hostname -I), followed by :3000. It should look like this:

    URL
    
    http://[IP ADDRESS]:3000/

    2: You should get a screen like the one below. Click Get Started to proceed with the setup steps:

    click get started
    Click “GET STARTED”

    3: Just race through the steps. But make sure you actually read them. If it complains that a port is in use, try a different one. I strongly recommend you have a Static IP Address set up on the Pi. NOTE: IN ORDER TO MAKE THIS NETWORK-WIDE, YOU HAVE TO SET UP “ROUTER” AS A DEVICE. IF YOU ALREADY ARE AT THE DASHBOARD, CLICK “SETUP GUIDE” IN THE MENU.

    Done

    1: You now have a full-functional AdGuard Home installation on a Pi. If you already configured devices on AdGuard Home, or you made it network-wide, you should already see stats.