How to Set Up a Raspberry Pi Home Server in 2026: A Step-by-Step Guide
Get a complete, step-by-step guide to building a home server on Raspberry Pi: from choosing an OS to setting up a file cloud and calculating costs.
Contents
- Hardware Preparation and Choosing an Operating System
- Initial Raspberry Pi Setup and SSH Connection
- Installation and configuration of core server services
- Practical security and optimization checklist
- Calculating home server costs and scaling options
- Common beginner mistakes and how to avoid them
- Summary: Your turnkey Raspberry Pi home server
Setting up a Raspberry Pi home server in 2026 is easier than it seems: all you need is to choose the right hardware, write the system image, and run a few basic commands. Once set up, you will have a reliable file server, media platform, or cloud managed from anywhere on the network.
According to TGRank, there are 105 Telegram channels in the "Technology and IT" category with a total audience of over 15 million subscribers, which confirms the high interest in DIY solutions. Below is a step-by-step guide to help you quickly assemble and launch your server.
Hardware Preparation and Choosing an Operating System
What You'll Need
- Raspberry Pi 5 (2.4 GHz quad-core processor, 8 GB RAM) – the core "brain" of the project.
- 5V 3A power supply with USB-C certification, at least 3A, to avoid voltage drops.
- MicroSD card, at least 32 GB, preferably 64 GB, Class 10 – ensures fast boot times and sufficient space for services.
- Case with ventilation holes and a cooling kit (heatsink + active fan) – keeps temperatures below 70 °C under load.
- Ethernet cable (or Wi-Fi module, if you plan on using a wireless connection) and a monitor with an HDMI cable for the initial setup.
Choosing a Linux Distribution
| Distribution | Image Size | Pi 5 Support | Installation Type |
|---|---|---|---|
| Raspberry Pi OS (Lite) | ≈ 2.5 GB | Official | Minimal package set, ideal for servers. |
| Ubuntu Server 22.04 LTS | ≈ 3.0 GB | Supported via ARM64 image | Broad ecosystem, convenient snap manager. |
| DietPi | ≈ 500 MB | Optimized for Pi 5 | Very lightweight, automatic installation of popular services. |
For most tasks, Raspberry Pi OS Lite is sufficient – it is lightweight, boots quickly, and has built-in apt support. If you need a more "universal" server with ready-made packages, choose Ubuntu Server. DietPi is suitable when minimizing memory usage is a priority.
Writing the Image to the Memory Card
- Download the desired image from the official distribution website.
- Install Raspberry Pi Imager (available for Windows, macOS, and Linux).
- In Imager, select "CHOOSE OS", specify the downloaded file, then "CHOOSE STORAGE" – select your microSD card.
- Enable the "SETTINGS" option → "Enable SSH" (this creates an
sshfile) and, if necessary, specify your Wi-Fi SSID and password. - Click "WRITE" – the process will take 2-3 minutes on a 64 GB card.
After writing, the card is ready for the first boot. Insert it into the Raspberry Pi, then connect the power supply and monitor.
Initial Raspberry Pi Setup and SSH Connection
First Boot and Basic Settings
- Power on the Pi – the system will boot into a text terminal.
- Enter the login pi and password raspberry.
- Change the password immediately using the
passwdcommand – this is your first line of defense. - Run
sudo raspi-config, go to "Localisation Options," and set your region, language, and keyboard layout. - Save the changes and reboot using
sudo reboot.
Enabling SSH and Configuring Wi-Fi/Ethernet
If an ssh file was already created in the image, the service is enabled automatically. For Ethernet, simply connect the cable to your router. To add Wi-Fi after the first boot:
- Open
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf. - Add this block:
network={
ssid="YOUR_SSID"
psk="YOUR_PASSWORD"
key_mgmt=WPA-PSK
}
- Save with
Ctrl+O, exit withCtrl+X - Restart the service with
sudo systemctl restart dhcpcd.
Now you can connect from any PC on the network:
ssh pi@192.168.1.XXSystem Update
Before installing services, update your packages:
- Update repository lists:
sudo apt update. - Install the latest versions:
sudo apt full-upgrade -y. - Clear the cache:
sudo apt autoremove -y && sudo apt clean.
After a reboot with sudo reboot, your system will be ready to install server applications.
If you want to compare advertising post prices in "Technology and IT" Telegram channels, check out the catalog of "Technology and IT" Telegram channels – for up-to-date statistics from TGRank.
Installation and configuration of core server services
File server (Samba)
Serves for file sharing between Windows, macOS, and Linux clients. On Raspberry Pi, it runs quickly even on the 4 GB model.
- Install the package:
sudo apt install samba -y. - Create a shared folder:
sudo mkdir -p /srv/samba/shareand set permissions:sudo chown -R pi:pi /srv/samba/share. - Edit
/etc/samba/smb.conf(add to the end): [Share] path = /srv/samba/share browseable = yes read only = no guest ok = yes - Restart the service:
sudo systemctl restart smbd. - From another PC, open
\\192.168.1.XX\Sharein File Explorer (Windows) orsmb://192.168.1.XX/Sharein Finder (macOS).
Cloud storage (Nextcloud)
Nextcloud provides a web interface, synchronization, and mobile clients. It runs on ARM processors without any issues.
- Install the necessary dependencies:
sudo apt install nginx php-fpm php-mysql php-xml php-gd php-curl php-zip php-bcmath -y. - Download the latest Nextcloud archive:
wget https://download.nextcloud.com/server/releases/nextcloud-27.0.0.zip -O /tmp/nextcloud.zipand unpack it to/var/www/:sudo unzip /tmp/nextcloud.zip -d /var/www/ && sudo mv /var/www/nextcloud /var/www/html/nextcloud. - Create a database:
sudo mysql -e "CREATE DATABASE nextcloud; CREATE USER 'nc_user'@'localhost' IDENTIFIED BY 'StrongPass!'; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nc_user'@'localhost'; FLUSH PRIVILEGES;". - Configure nginx (file
/etc/nginx/sites-available/nextcloud): server { listen 80; server_name pi-home.local; root /var/www/html/nextcloud; index index.php index.html; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.2-fpm.sock; } } - Activate the config:
sudo ln -s /etc/nginx/sites-available/nextcloud /etc/nginx/sites-enabled/ && sudo nginx -t && sudo systemctl restart nginx. After this, openhttp://192.168.1.XX/nextcloudand complete the installation via your browser.
Web server (Apache/Nginx)
For simple websites, Nginx is often enough, but Apache remains popular for PHP applications.
- Nginx – installation:
sudo apt install nginx -y. Replace the configuration file/etc/nginx/sites-available/defaultwith: server { listen 80; server_name pi.local; root /var/www/html; index index.html index.htm; } Restart:sudo systemctl restart nginx. Access:http://192.168.1.XX. - Apache – installation:
sudo apt install apache2 -y. The directory/var/www/htmlis already ready. Check viahttp://192.168.1.XX.
Database (MariaDB)
MariaDB is suitable for most web applications and scales easily.
- Install the server:
sudo apt install mariadb-server -y. - Run the secure configuration:
sudo mysql_secure_installation. Set the root password, disable anonymous access, and remove the test database. - Create a user for applications: sudo mysql -e "CREATE USER 'app_user'@'localhost' IDENTIFIED BY 'StrongPass!'; GRANT ALL PRIVILEGES ON *.* TO 'app_user'@'localhost'; FLUSH PRIVILEGES;"
- Check that it works:
mysql -u app_user -p -e "SHOW DATABASES;". Access from PHP scripts will be via the same credentials.
Practical security and optimization checklist
Firewall and port restrictions
| Action | Command | Recommendation |
|---|---|---|
| Install ufw | sudo apt install ufw -y | Basic filter, easy to manage. |
| Allow SSH only from local network | sudo ufw allow from 192.168.1.0/24 to any port 22 | Avoid access from the internet. |
| Open service ports | sudo ufw allow 80/tcp && sudo ufw allow 443/tcp && sudo ufw allow 139/tcp && sudo ufw allow 445/tcp | Only those that are actually needed. |
| Enable firewall | sudo ufw enable | After checking the rules. |
Updates and automatic service restarts
- Enable automatic security updates:
sudo apt install unattended-upgrades -y && sudo dpkg-reconfigure unattended-upgrades. - Configure a systemd timer to restart critical services if they crash: sudo systemctl enable --now nginx sudo systemctl enable --now mariadb
- Change the SSH password and disable root login:
passwd pi, then in/etc/ssh/sshd_configsetPermitRootLogin noandPasswordAuthentication no(use keys). - Install fail2ban for brute-force protection:
sudo apt install fail2ban -y. It protects SSH by default.
Load monitoring (htop, netdata)
Monitoring the load helps identify "bottlenecks" in time.
- Install htop:
sudo apt install htop -y. Runninghtopshows CPU, memory, and processes in real time. - For a more detailed graph, install netdata:
bash
Calculating home server costs and scaling options
Base build budget
To get started, you'll need a Raspberry Pi 5 (≈ 7 500 ₽), a 5 V 3 A power supply (≈ 1 200 ₽), a 32 GB Class 10 microSD card (≈ 800 ₽), and a case with ventilation (≈ 1 000 ₽). The total cost for the base configuration will be ≈ 10 500 ₽.
Additional accessories (SSD, HAT module)
For file storage, it's better to connect an external 1 TB SSD (for example, Samsung 870 EVO, ≈ 9 000 ₽) via a USB-3.0-adapter (≈ 600 ₽). If you plan to use the Pi as a media server, it makes sense to add a "Pi-Cool" HAT module with an active cooler and temperature sensor (≈ 1 500 ₽). The total cost of the expanded build is ≈ 21 600 ₽.
Comparison with commercial NAS
| Device | Price, ₽ | Performance (read/write) | Flexibility |
|---|---|---|---|
| Raspberry Pi 5 + 1 TB SSD | ≈ 21 600 | ≈ 350 MB/s (USB-3.0) | Full access to Linux environment |
| Synology DS220+ | ≈ 33 000 | ≈ 225 MB/s (2 × LAN) | GUI management, packages |
| QNAP TS-231K | ≈ 29 000 | ≈ 200 MB/s (Gigabit) | Built-in RAID, applications |
In terms of price, the Pi wins by nearly double, and in terms of flexibility, it has no OS restrictions. As the load increases, you can add a second SSD via a USB-3.0-hub or upgrade to a more powerful SBC (for example, Raspberry Pi Compute Module 4). For a comparison of prices and audiences of Telegram channels in the "Technology and IT" category, see the
Common beginner mistakes and how to avoid them
Incorrect power supply
- Reason: Using a cheap adapter without a stable 5V 3A output.
- Consequences: Random reboots, file system corruption.
- Recommendation: Buy an original Raspberry Pi power supply or a certified alternative, and check the voltage with a multimeter.
Ignoring updates
- Reason: Rarely running
apt update && apt upgrade. - Consequences: Vulnerabilities, incompatibility with new packages.
- Recommendation: Set up an automatic cron script, for example,
0 3 * * 0 apt update && apt upgrade -y, and check logs regularly.
Overheating due to lack of cooling
- Reason: No fan or passive heatsink.
- Consequences: CPU throttling, performance drops during prolonged operation.
- Recommendation: Install an active cooler (Pi-Cool) and place the server in a well-ventilated area; add a temperature sensor and an automatic script to reduce load if the temperature exceeds 80 °C.
Regularly check the temperature with the vcgencmd measure_temp command and adjust cooling before problems arise.
Summary: Your turnkey Raspberry Pi home server
After following all the steps, you have a fully functional file and media server, a web management interface, and basic backup services up and running. The easiest way to verify that services are working is via the systemctl status command and your browser by opening http://IP-address:/port.
Quick check
- SSH access:
ssh pi@IPresponds without delay. - Web interface (e.g., Nextcloud) opens and shows storage status.
- SMB shares are visible from Windows/Mac, allowing you to copy files.
- Auto-updates and temperature monitoring are running on schedule.
Backups and recovery
Set up a daily backup of the /var/www directory and user data to an external USB drive or the cloud (rclone + Backblaze). A script in /etc/cron.daily should run rsync -a --delete /home/pi/backup /mnt/usb. Regularly check the /var/log/rsync.log logs and test your recovery process.
Savings and scaling
Currently, your server consumes ~3 W, which costs about 3 USD per month at a rate of 0.10 USD/kWh. If you need to add disk space, connect another SSD via USB 3.0 and expand your docker-compose files.
Maintenance recommendations
- Check for updates once a week, or at least once a month.
- Monitor the temperature: if it goes above 80 °C, increase the fan speed.
- Check the file integrity of critical storage once a month using
md5sum. - Update passwords and SSH keys at least every six months.
"A home server is not a 'set-and-forget' project, but a living service that requires periodic checks and tuning."
According to TGRank, in the "Technology and IT" category in the Telegram channel directory, there are 105 channels with a total audience of 15,142,048 subscribers and a median engagement rate of 6.4%. If you plan to share your experience or advertise your solutions, take a look at the "Technology and IT" Telegram channel directory.
In short, your Raspberry Pi is ready to serve your family: storing photos, streaming media, syncing documents, and even running small web applications. The key is to keep it up to date and perform regular backups.
Telegram channels on the topic
Picked by the TGRank team: channels with a real audience — to read and to advertise in
Хотите понять, как превратить небольшие доходы в первый миллион? Канал «Первый Миллион» предлагает пошаговые стратегии накопления и инвестиций, проверенные примерами реа…
✓
Теория бизнеса раскрывается здесь через призму научных исследований и проверенных моделей управления. Автор публикует разборы классических и современных концепций, сопро…
✓
«Бизнес Империя» — платформа для амбициозных владельцев компаний и стартаперов. Канал регулярно делится аналитикой рынков, советами по масштабированию и примерами из реа…
Технологический мир будущего раскрывается в «Точки над ИИ». Канал посвящён искусственному интеллекту, машинному обучению и их влиянию на индустрии. Вы получите обзоры но…
✓
«Своё Дело | Бизнес | Финансы» предлагает практические советы для предпринимателей и инвесторов. В публикациях разбираются стратегии роста, налогообложение, управление д…


