Home > Blog > tech

Raspberry Pi Home Server 2026 สร้าง Self-Hosted Server ที่บ้านสำหรับ Developer

Raspberry Pi Home Server 2026 สร้าง Self-Hosted Server ที่บ้านสำหรับ Developer
2026-04-17 | tech | 3400 words

Raspberry Pi 5 (เปิดตัว 2023) มี 8GB RAM, CPU ARM Cortex-A76 Quad-core 2.4GHz, PCIe 2.0 ทำให้สามารถรันงาน Server ได้จริงจัง ในปี 2026 การสร้าง Home Server ด้วย Raspberry Pi เป็นทางเลือกยอดนิยมของ Developer และ Tech Enthusiast ที่ต้องการ Self-Host บริการต่างๆ เช่น Cloud Storage, Ad-blocker, VPN, Smart Home, Media Server โดยใช้ไฟฟ้าน้อยมาก (5-10W) และประหยัดกว่าเช่า Cloud

Raspberry Pi รุ่นที่เหมาะสำหรับ Server

รุ่นCPURAMราคาเหมาะกับ
Pi 5 (8GB)ARM Cortex-A76 2.4GHz8GB~3,800Server จริงจัง
Pi 5 (4GB)ARM Cortex-A76 2.4GHz4GB~2,800Server ทั่วไป
Pi 4 (8GB)ARM Cortex-A72 1.5GHz8GB~3,200Server รอง
Pi 4 (4GB)ARM Cortex-A72 1.5GHz4GB~2,300Pi-hole, VPN
Pi Zero 2WARM Cortex-A53 1GHz512MB~700IoT, Single service

อุปกรณ์ที่ต้องใช้

# =============================================
# Hardware List (ราคารวม ~6,000-10,000 บาท):
# =============================================
#
# 1. Raspberry Pi 5 (8GB)            3,800
# 2. Power Adapter 27W (USB-C PD)      900
# 3. Heat Sink + Fan Active Cooler     500
# 4. Case (Plastic/Aluminium)          600
# 5. microSD Card 128GB (A2, U3)      500
# 6. External SSD 1TB (USB 3.0)      2,500
#    → สำหรับเก็บข้อมูล (แนะนำ)
# 7. Ethernet Cable Cat6              200
# 8. HDMI Cable Micro-HDMI             300
# 9. Keyboard + Mouse (setup)         500
#    → ใช้ครั้งเดียวตอนตั้งค่า
# ─────────────────────────────────────
# รวม: ~10,000 บาท
#
# Optional:
# - UPS (Power Bank)          1,500
# - External HDD 4TB          3,000
# - PoE HAT (ต่อไฟผ่าน LAN)   1,200

ขั้นตอนติดตั้ง OS

# =============================================
# 1. Flash OS ลง microSD:
# =============================================
# Download: Raspberry Pi Imager
# https://www.raspberrypi.com/software/
#
# เลือก OS:
# → Raspberry Pi OS Lite (64-bit) - แนะนำสำหรับ Server
# → Ubuntu Server 24.04 LTS - ถ้าถนัด Ubuntu
#
# ตั้งค่าล่วงหน้า (Advanced Options):
# - Hostname: homeserver
# - Enable SSH (Password auth)
# - Set username: pi, password: xxx
# - WiFi: ถ้าใช้ (แนะนำ LAN)
# - Locale: Asia/Bangkok
#
# =============================================
# 2. First Boot:
# =============================================
# - เสียบ SD Card
# - เสียบ LAN Cable
# - เสียบไฟ
# - รอ 2-3 นาที
#
# หา IP Address:
# - ดูที่ Router Admin Page
# - หรือใช้ nmap: nmap -sn 192.168.1.0/24
#
# =============================================
# 3. SSH เข้า:
# =============================================
# ssh pi@192.168.1.xxx
#
# =============================================
# 4. Update System:
# =============================================
# sudo apt update && sudo apt upgrade -y
# sudo apt install -y curl git vim htop

Setup Docker (หัวใจของ Home Server)

# =============================================
# Install Docker บน Raspberry Pi:
# =============================================
# curl -fsSL https://get.docker.com | sh
# sudo usermod -aG docker pi
# sudo systemctl enable docker
#
# Logout + Login ใหม่
# ตรวจสอบ:
# docker --version
# docker ps
#
# Install Docker Compose:
# sudo apt install -y docker-compose-plugin
#
# =============================================
# Portainer (Docker Web UI):
# =============================================
# docker volume create portainer_data
# docker run -d --name portainer \
#   --restart=always \
#   -p 9443:9443 \
#   -v /var/run/docker.sock:/var/run/docker.sock \
#   -v portainer_data:/data \
#   portainer/portainer-ce:latest
#
# เข้าใช้: https://192.168.1.xxx:9443

Pi-hole (Ad-blocker ทั้งบ้าน)

# =============================================
# Pi-hole คือ:
# =============================================
# → DNS Server ที่ block โฆษณาและ Tracker
# → ใช้ได้ทุกอุปกรณ์ในบ้าน (PC, Phone, TV)
# → ประหยัด Bandwidth 20-40%
#
# =============================================
# Install Pi-hole (Docker):
# =============================================
# mkdir ~/pihole && cd ~/pihole
#
# docker-compose.yml:
# version: "3"
# services:
#   pihole:
#     container_name: pihole
#     image: pihole/pihole:latest
#     ports:
#       - "53:53/tcp"
#       - "53:53/udp"
#       - "80:80/tcp"
#     environment:
#       TZ: 'Asia/Bangkok'
#       WEBPASSWORD: 'your_password'
#     volumes:
#       - './etc-pihole:/etc/pihole'
#       - './etc-dnsmasq.d:/etc/dnsmasq.d'
#     restart: unless-stopped
#
# docker-compose up -d
#
# =============================================
# ตั้งค่า Router:
# =============================================
# → ตั้ง DNS ของ Router = IP ของ Pi
# → อุปกรณ์ทุกเครื่องจะใช้ Pi-hole อัตโนมัติ
# → Block 10,000+ โฆษณาทันที!

Nextcloud (Google Drive ของคุณเอง)

# =============================================
# Nextcloud คือ:
# =============================================
# → File Storage แบบ Google Drive/Dropbox
# → Calendar, Contacts, Notes
# → Document Editing (OnlyOffice)
# → Sync ทุกอุปกรณ์
# → ข้อมูลอยู่ที่บ้านคุณ 100%
#
# =============================================
# Install (Docker Compose):
# =============================================
# mkdir ~/nextcloud && cd ~/nextcloud
#
# docker-compose.yml:
# version: '3'
# services:
#   nextcloud-db:
#     image: mariadb:latest
#     restart: always
#     command: --transaction-isolation=READ-COMMITTED
#     volumes:
#       - ./db:/var/lib/mysql
#     environment:
#       MYSQL_ROOT_PASSWORD: root_password
#       MYSQL_DATABASE: nextcloud
#       MYSQL_USER: nextcloud
#       MYSQL_PASSWORD: ncpassword
#
#   nextcloud:
#     image: nextcloud:latest
#     restart: always
#     ports:
#       - "8080:80"
#     volumes:
#       - ./data:/var/www/html
#       - /mnt/ssd/nextcloud:/var/www/html/data
#     environment:
#       MYSQL_HOST: nextcloud-db
#       MYSQL_DATABASE: nextcloud
#       MYSQL_USER: nextcloud
#       MYSQL_PASSWORD: ncpassword
#
# docker-compose up -d
# เข้าใช้: http://192.168.1.xxx:8080

Home Assistant (Smart Home)

# =============================================
# Home Assistant:
# =============================================
# → ควบคุมอุปกรณ์ Smart Home
# → รองรับ 2,000+ Integrations
# → Automation (เปิดแอร์ตอนกลับบ้าน)
# → Dashboard สวยงาม
#
# Install:
# mkdir ~/homeassistant && cd ~/homeassistant
#
# docker-compose.yml:
# version: '3'
# services:
#   homeassistant:
#     container_name: homeassistant
#     image: ghcr.io/home-assistant/home-assistant:stable
#     volumes:
#       - ./config:/config
#       - /etc/localtime:/etc/localtime:ro
#     restart: unless-stopped
#     privileged: true
#     network_mode: host
#
# docker-compose up -d
# เข้าใช้: http://192.168.1.xxx:8123

Jellyfin (Netflix ของคุณเอง)

# =============================================
# Jellyfin:
# =============================================
# → Media Server (หนัง, ซีรีส์, เพลง)
# → Streaming ทุกอุปกรณ์ (TV, Phone, PC)
# → ฟรี Open Source (ไม่ต้องสมัคร)
# → Hardware Transcoding (ใน Pi 5)
#
# Install:
# docker run -d --name jellyfin \
#   --restart=unless-stopped \
#   --device=/dev/dri:/dev/dri \
#   -p 8096:8096 \
#   -v ~/jellyfin/config:/config \
#   -v ~/jellyfin/cache:/cache \
#   -v /mnt/ssd/media:/media \
#   jellyfin/jellyfin:latest
#
# เข้าใช้: http://192.168.1.xxx:8096
# Scan Library → เพลิดเพลิน!

Wireguard VPN (เข้าบ้านจากไกล)

# =============================================
# Wireguard VPN:
# =============================================
# → VPN ไว้เชื่อมเข้าบ้านจากไกล
# → เข้าถึง Pi-hole, Nextcloud, Jellyfin ได้
# → เร็วกว่า OpenVPN 4-5 เท่า
#
# Install (wg-easy - Web UI):
# docker run -d \
#   --name=wg-easy \
#   --restart=unless-stopped \
#   -p 51820:51820/udp \
#   -p 51821:51821/tcp \
#   -v ~/wireguard:/etc/wireguard \
#   -e WG_HOST=your-domain-or-ip \
#   -e PASSWORD=your_password \
#   --cap-add=NET_ADMIN \
#   --cap-add=SYS_MODULE \
#   ghcr.io/wg-easy/wg-easy
#
# เข้าใช้: http://192.168.1.xxx:51821
# สร้าง Profile → Export → Import เข้ามือถือ
# เชื่อม VPN → เข้าบ้านได้จากทุกที่!
#
# =============================================
# Port Forwarding (ที่ Router):
# =============================================
# → Forward Port 51820/UDP → Pi IP
# → เพื่อให้เชื่อมจากภายนอกได้

Monitoring (Grafana + Prometheus)

# =============================================
# Monitoring Stack:
# =============================================
# → Prometheus: เก็บ Metrics
# → Grafana: แสดง Dashboard
# → Node Exporter: ข้อมูล CPU/RAM/Disk
#
# docker-compose.yml:
# version: '3'
# services:
#   prometheus:
#     image: prom/prometheus
#     ports:
#       - "9090:9090"
#     volumes:
#       - ./prometheus.yml:/etc/prometheus/prometheus.yml
#
#   grafana:
#     image: grafana/grafana
#     ports:
#       - "3000:3000"
#     environment:
#       GF_SECURITY_ADMIN_PASSWORD: admin
#
#   node_exporter:
#     image: prom/node-exporter
#     ports:
#       - "9100:9100"
#
# เข้าใช้ Grafana: http://192.168.1.xxx:3000
# Import Dashboard ID: 1860 (Node Exporter Full)
# → เห็น CPU, RAM, Disk, Network ทั้งหมด

Backup Strategy

# =============================================
# Backup ข้อมูลสำคัญ:
# =============================================
#
# 1. rsync (Local Backup):
# rsync -avh --progress \
#   /mnt/ssd/data/ \
#   /mnt/backup/data/
#
# 2. Cron Job (Auto Backup รายวัน):
# crontab -e
# 0 2 * * * rsync -avh /mnt/ssd/data/ /mnt/backup/
#
# 3. Cloud Backup (Restic to B2/S3):
# restic -r b2:mybucket:backup init
# restic -r b2:mybucket:backup backup /mnt/ssd/data
#
# 4. SD Card Image (Disaster Recovery):
# # รัน PC:
# sudo dd if=/dev/sdX of=pi-backup.img bs=4M
#
# =============================================
# 3-2-1 Backup Rule:
# =============================================
# → 3 Copies ของข้อมูล
# → 2 Different Media (SSD + Cloud)
# → 1 Offsite (Backblaze B2)

Security Best Practices

# =============================================
# 1. Change Default Password:
# =============================================
# passwd
#
# 2. Disable Password SSH (ใช้ Key):
# ssh-keygen -t ed25519
# ssh-copy-id pi@192.168.1.xxx
# sudo nano /etc/ssh/sshd_config
# → PasswordAuthentication no
# sudo systemctl restart sshd
#
# 3. Firewall (UFW):
# sudo apt install ufw
# sudo ufw allow 22/tcp     # SSH
# sudo ufw allow 80/tcp     # Pi-hole
# sudo ufw allow 53         # DNS
# sudo ufw enable
#
# 4. Fail2ban (Brute-force protection):
# sudo apt install fail2ban
# sudo systemctl enable fail2ban
#
# 5. Auto Updates:
# sudo apt install unattended-upgrades
# sudo dpkg-reconfigure unattended-upgrades
#
# 6. Docker Security:
# → รัน Container แบบ non-root
# → ใช้ Read-only filesystem
# → Limit Resources
#
# 7. ไม่เปิด Port ออกเน็ต:
# → ใช้ VPN เชื่อมจากข้างนอก
# → ถ้าจำเป็น ใช้ Cloudflare Tunnel

Use Cases สำหรับ Developer

บริการใช้แทนประหยัด/ปี
NextcloudGoogle Drive (2TB)4,000 บาท
JellyfinNetflix5,400 บาท
Pi-holeAdGuard Premium1,500 บาท
Wireguard VPNNordVPN3,000 บาท
GiteaGitHub Pro2,000 บาท
Bitwarden1Password1,500 บาท
Home AssistantSmartThings2,000 บาท

รวม: ประหยัด ~19,400 บาท/ปี! ค่าอุปกรณ์ 10,000 บาท คืนทุนภายใน 6 เดือน

Power Consumption

# =============================================
# ใช้ไฟเท่าไหร่?
# =============================================
#
# Raspberry Pi 5 (8GB):
# → Idle: 2-3W
# → Load: 5-8W
# → เฉลี่ย: 4W
#
# คำนวณค่าไฟ/เดือน:
# 4W × 24h × 30d = 2,880 Wh = 2.88 kWh
# × 4 บาท/kWh = ~12 บาท/เดือน
#
# ค่าไฟ/ปี: ~144 บาท!
# เทียบกับเช่า Cloud: 6,000-20,000 บาท/ปี

สรุป: Raspberry Pi Home Server

Raspberry Pi 5 เป็นอุปกรณ์ที่คุ้มค่าที่สุดสำหรับการสร้าง Home Server ปี 2026 ด้วยราคาเริ่มต้น 10,000 บาท ประหยัดไฟ (ค่าไฟปีละ 150 บาท) และได้บริการ Self-Hosted ครบครัน ตั้งแต่ Nextcloud, Jellyfin, Pi-hole, VPN ช่วยประหยัดค่า Subscription ปีละเกือบ 20,000 บาท เหมาะสำหรับ Developer ที่ต้องการเรียนรู้ Docker, Linux Administration และ Self-Hosting โดยลงมือทำจริง


Back to Blog | iCafe Forex | SiamLanCard | Siam2R