How to Build a Powerful DIY Server for Smart Home
Please read Liability Disclaimer and License Agreement CAREFULLY
Welcome to my DIY server page, where I showcase a powerful and versatile server that runs on Ubuntu Server, Apache, MySql, PHP, Samba, Jellyfin, NextCloud, OpenJDK, NodeJS, MQTT, Zigbee, OpenHAB, Docker Compose, Frigate NVR, DeepStack, and Edge TPU.
My DIY server is the perfect solution for those who want to have complete control over their data, applications, and media.
With Ubuntu Server, you have access to a reliable and secure operating system that is optimized for server use.
Apache, MySql, and PHP provide a powerful web server stack that is essential for running dynamic websites and applications.
Samba allows for easy file sharing across multiple platforms, while Jellyfin or Plex provide a media server platform that can stream your favorite movies, TV shows, and music.
NextCloud is a self-hosted cloud solution that allows you to store and access your files, contacts, and calendars securely.
OpenJDK, NodeJS, MQTT, Zigbee, and OpenHAB are essential tools for running IoT and smart home applications.
With Docker Compose, you can easily manage and deploy containerized applications, and Frigate NVR provides a powerful video surveillance solution.
DeepStack and Edge TPU are AI accelerators that allow you to run machine learning and computer vision workloads.
This DIY server is easy to set up and customize to your specific needs. Whether you want to host your own website, run your own cloud, or build your own smart home, this server has everything you need.
So why wait? Start building your own DIY server today!
Things we need:
1. A computer to install the software on. In this case I went with a mini PC, HP ProDesk 400 G3 Desktop Mini we will call it from now on "Server".
I am more interested in HDD capacity and life time than speed.
2. A USB stick to flash Ubuntu on it.
3. A monitor, network cable, keyboard and mouse to connect to server. I am assuming that you already have a router and you know how to use it.
4. A computer (Windows, Linux) to use it in the preparation activities, we will call it from now on "Helper".
5. Prepare yourself to use Ubuntu Terminal, you will use it a lot.
Let's start the installation
1. Make sure Helper is connected to your local network
3. Check on internet how to access your Server Bios to set up the Boot Order, we need to make sure we will boot from the USB stick.
5. Update the system by using the following commands
Then type in you credentials (username and password)
sudo apt-get update
sudo apt-get upgrade
Reboot your Server
6. Set your Server IP static by following this tutorial, you can do this also from your router interface by checking this How To from Asus. I have use 10.0.1.2 for Server as the router has the 10.0.1.1.
7. Enable Secure Shell Network Protocol this feature will allow us to access the Server after we finish the set up without having any display, keyboard or mouse connected to server, we use only the Helper computer with Putty (open-source terminal emulator, serial console and network file transfer application) install on it.
8. Test you SSH connection from your Helper towards Server, if you can connect remotely then you can remove the display, keyboard and mouse from Server, and place it in a secure place connected to network (preferably using gigabit wired network cable). My recommendation is to buy and use also an UPS (Uninterruptible Power Supplies) , I am using APC Back-UPS, 500VA/300W.
9. Install Webmin (is a web-based system administration tool for Unix-like servers) by following this guide. This will allow us to access our server from a web based interface, making the life more easier for those who dislike the Terminal.
These 3 tools will allow local webpage development and they will be used by other applications installed on Server
11. Install Samba server by following this guide to transform our Server in a NAS (Network Attached Storage) and we will be able to have a common location on network for most common used files (pictures, music, movies and others).
My personal choice is Jellyfin as it doesn't require paid subscription for hardware decoding.
17. Install Mosquitto MQTT Broker
Check the hardware pictures in Smart Home Server Hardware.
Before you pair any sensors or devices in ZigBee please check if you have any interference between the 2.4GHz Wi-Fi network and ZigBee network by reading this article, then set up your ZigBee or Wi-Fi channels.
For a example of configuration file for Zigbee2MQTT check this article Zigbee2MQTT configuration
I will not stop here, I want to be able to have in Smart Home the possibility to detect the presence of persons and detect objects or animals using surveillance camera's.
To be able to do this I need to have some AI power installed on the server, the next steps are needed only if you intend to follow this approach also.
For a example of configuration file for DockerCompose check this article Docker Compose Configuration
For a example of configuration file for Frigate NVR check this article Frigate NVR Configuration, it also sends data to MQTT from Hikvision DS-2CD2463G0-I Camera.
due to the way the PCIe lanes are split. To install the software support for it you have to follow this guide.
Check the hardware pictures in Smart Home Server Hardware