Introduction
In a world where cloud storage services dominate, taking control of your own data has never been more empowering or cost-effective. Whether you’re a small business looking to reduce expenses, a tech enthusiast seeking a personal project, or an individual prioritizing data privacy, building your own storage server can be a game-changer.
This detailed guide chronicles the process of setting up a dedicated storage server using a Dell PowerEdge T150, Ubuntu 24.04, and Nextcloud. From hardware selection to configuring software and ensuring security, this walkthrough provides the tools you need to create a scalable, secure, and private solution for managing your data. Say goodbye to expensive storage subscriptions and hello to complete control.
Why Choose Linux Over Windows Server?
For businesses and individuals managing IT infrastructure, the choice between Windows Server and Linux can have significant implications on cost, flexibility, and long-term scalability. While Windows Server offers familiarity and tight integration with Microsoft ecosystems, it comes with high licensing fees, additional costs for access, and a more restrictive environment.
On the other hand, Linux, with distributions like Ubuntu, provides a free, open-source, and highly customizable alternative. Linux eliminates the need for costly licenses, supports a broad range of hardware, and offers powerful tools for security and remote access at no additional charge. This makes it particularly appealing to small businesses, developers, and privacy-conscious users.
The table below compares the two options, highlighting why Linux often emerges as the more cost-effective, flexible, and secure choice for self-hosted solutions. Whether you’re looking to reduce expenses or gain more control over your infrastructure, Linux delivers on every front.
Comparison of Windows Server vs. Ubuntu
Feature | Windows Server | Ubuntu (Linux) |
---|---|---|
Cost (Licensing) | – Standard Edition: $1,069+ (one-time) | Free and open-source. Optional enterprise support (~$225/year for Ubuntu Pro). |
– Datacenter Edition: $6,155+ (one-time) | ||
Client Access Licenses | Required ($38–$199 per user/device, one-time). | Not required. |
Remote Access | RDS CALs ($100–$120 per user/device, one-time). | Free tools (e.g., xrdp, VNC, SSH with GUI). |
Upgrades | Additional cost for new versions or via Software Assurance (~25–30% of license cost annually). | Free upgrades. |
Support | Paid (via Software Assurance or Microsoft support plans). | Free community support or optional enterprise support (~$225/year for Ubuntu Pro). |
Ease of Use | User-friendly GUI, suitable for administrators familiar with Windows ecosystems. | Command-line focused but offers GUIs like GNOME for desktop/server administration. |
Hardware Requirements | Higher system requirements for similar performance. | Lightweight, can run efficiently on older hardware. |
Security | Regular patches, but closed-source and telemetry are enabled by default. | Open-source, strong community oversight, no telemetry. |
Customization | Limited due to proprietary nature. | Highly customizable with open-source software and configurations. |
Ecosystem | Tight integration with Microsoft products (e.g., Active Directory, Office 365). | Works well with a wide range of open-source tools and platforms (e.g., Apache, Samba). |
Virtualization | Hyper-V included. | Free tools (e.g., KVM, VirtualBox, Docker) available. |
Backup Options | Built-in tools often require additional licenses or third-party software. | Free options (e.g., rsync, Duplicati) and integration with open-source backup solutions. |
Community Support | Limited, focused on enterprise users. | Vibrant community with extensive forums, guides, and free resources. |
Use Cases | Ideal for organizations invested in Microsoft products. | Great for cost-conscious users, developers, and tech-savvy businesses. |
Total Cost of Ownership | High: Includes CALs, RDS CALs, upgrades, and optional Software Assurance. | Low: No licensing costs, free upgrades, and minimal additional expenses. |
Cloud Integration | Seamless integration with Microsoft Azure. | Compatible with all major cloud providers, including AWS, Google Cloud, and Azure. |
Performance | Can be resource-intensive for similar tasks. | Optimized for performance, especially on servers. |
Things You Will Need
Hardware:
- Server, for this guide I chose the Dell PowerEdge T150 Server
- Intel Xeon E-2334 processor
- 16GB ECC memory
- Two 960GB SSDs (configured in RAID 1 for redundancy)
- Keyboard, monitor, and mouse for initial setup (optional if using remote management tools like iDRAC).
Software:
- Ubuntu 24.04 LTS ISO: Download from the official Ubuntu website.
- Nextcloud: Installable with a click with a cPanel instance.
- Tools like Rufus (for creating bootable USB) or equivalent.
Network:
- A static IP address for the server.
- Internet access for downloading updates and packages.
Optional Tools:
- An additional external drive or backup solution for automated backups.
- Uninterrupted Power Supply (UPS) for power protection.
1. Choosing the Right Server
Why the Dell PowerEdge T150?
The Dell PowerEdge T150 offers excellent value for small to medium-sized storage needs. It was chosen for its:
- Performance: Intel Xeon E-2334 processor and 16GB ECC memory.
- Storage Capacity: Two 960GB SSDs with RAID 1 configuration for redundancy.
- Flexibility: Room for expansion and compatibility with Linux operating systems.
2. Installing Ubuntu 24.04
Step 1: Preparing Boot Media
- Download the latest version of Ubuntu ISO.
- Create a bootable USB using Rufus or
dd
on Linux:sudo dd if=ubuntu-24.04.iso of=/dev/sdX bs=4M status=progress
Step 2: Installation
- Boot from the USB on the T150.
- Follow the installation wizard:
- Configure language, timezone, and disk partitioning.
- Set up Logical Volume Management (LVM) for flexibility.
- Create an admin user account.
3. Configuring the Network
Step 1: Assign a Static IP
Edit the Netplan configuration:
sudo nano /etc/netplan/50-cloud-init.yaml
Example configuration:
network:
version: 2
ethernets:
eno8403:
dhcp4: false
addresses:
- 192.168.0.10/24
gateway4: 192.168.0.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
Apply the configuration:
sudo netplan apply
4. Setting Up Nextcloud
Step 1: Install Nextcloud
- Use the Snap package for ease of installation:
sudo snap install nextcloud
Step 2: Configure External Storage
- Create a storage mount point:
sudo mkdir /mnt/nextcloud_data
- Mount additional storage:
sudo mkfs.ext4 /dev/sdb1 sudo mount /dev/sdb1 /mnt/nextcloud_data
- Update
/etc/fstab
for persistent mounting:/dev/sdb1 /mnt/nextcloud_data ext4 defaults 0 0
Step 3: Set Permissions
Ensure Nextcloud has access:
sudo chown -R www-data:www-data /mnt/nextcloud_data
sudo chmod -R 770 /mnt/nextcloud_data
5. Securing the Server
Step 1: Configure SSH
One of the first steps in securing your server is to change the default SSH port, which helps reduce the risk of automated attacks that target common ports (like port 22). By changing the SSH port and applying additional restrictions, you can significantly improve your server’s security.
- Open the SSH configuration file:
- Update the following settings:
- Disable root login:
- Disable password authentication (use SSH keys instead):
- Restrict SSH access to specific users:
- Change the default SSH port to 3387 (or a port of your choice):
- Save the file and restart the SSH service:
Step 2: Enable Firewall
Next, configure the Uncomplicated Firewall (UFW) to allow traffic on your new SSH port and block unnecessary connections:
- Install UFW:
- Allow only essential ports:
- SSH on the new port (3387):
- HTTP and HTTPS for web traffic:
- Enable the firewall:
Step 3: Install Fail2Ban
To further protect your server against brute-force attacks, use Fail2Ban, which blocks IP addresses that repeatedly fail to log in.
- Install Fail2Ban:
- Configure SSH protection:
- Edit or create the Fail2Ban jail configuration file:
- Add the following settings for SSH:
- Save the file and restart Fail2Ban:
Why Change the Default SSH Port?
Changing the default SSH port (from the commonly used port 22) helps obscure your server from bots and automated scripts that scan for open ports on default settings. Coupled with a strong firewall and brute-force protection, this step forms the foundation of a robust security strategy for your server.
6. Automating Backups
Step 1: Install Rsync
Rsync is a robust tool for backups:
sudo apt install rsync -y
Step 2: Create a Backup Script
- Write a script to sync data to
/mnt/backup
:sudo nano /usr/local/bin/backup.sh
Example:
#!/bin/bash rsync -av /mnt/nextcloud_data /mnt/backup
- Make the script executable:
sudo chmod +x /usr/local/bin/backup.sh
Step 3: Schedule with Cron
- Open crontab:
crontab -e
- Add a daily backup job:
0 0 * * * /usr/local/bin/backup.sh
7. Monitoring and Maintenance
Step 1: Install Monitoring Tools
Install tools like htop
and iotop
:
sudo apt install htop iotop sysstat -y
Step 2: Regular Updates
Enable unattended upgrades:
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure unattended-upgrades
Step 3: Conduct Security Audits
Install Lynis:
sudo apt install lynis -y
sudo lynis audit system
Why Host the Nextcloud Instance on a cPanel Server While Using an Ubuntu Server for Storage?
When setting up a robust, secure, and scalable Nextcloud environment, it’s important to consider the separation of roles between the application layer and the storage backend. Here’s why we chose to host the Nextcloud instance on a cPanel server with Thexyz while using an Ubuntu server strictly for storage:
1. Simplified Application Management with cPanel
Hosting the Nextcloud instance on a cPanel server with Thexyz provides several benefits for managing the application layer:
- User-Friendly Interface: cPanel simplifies tasks like domain management, email setup, SSL installation, and backups, making it easier for administrators to manage Nextcloud without diving deep into command-line configurations.
- High Availability: Thexyz’s cPanel hosting ensures that the Nextcloud application layer is always accessible with reliable uptime and performance.
- Built-In Security: Thexyz offers enterprise-grade security features, including web application firewalls and DDoS protection, reducing the risk of vulnerabilities at the application level.
- Automatic Updates: cPanel automates many Nextcloud updates, ensuring the application remains up-to-date without manual intervention.
2. Dedicated Ubuntu Server for Storage
Using a dedicated Ubuntu server as the storage backend allows us to separate the file storage infrastructure from the application layer, optimizing both performance and security:
- Enhanced Performance: By offloading storage tasks to a separate server, the cPanel server running Nextcloud can dedicate its resources to application tasks like user authentication, file indexing, and web access.
- Scalability: The Ubuntu server can be easily expanded with additional storage capacity, RAID configurations, or network storage solutions to meet growing data demands.
- Improved Security: The dedicated storage server can be configured with strict access controls (e.g., SSH, firewalls, and Fail2Ban) to protect sensitive data. Only the cPanel server communicates directly with the storage backend.
- Cost Efficiency: The Ubuntu server eliminates the need for expensive cloud storage subscriptions, offering a self-hosted and cost-effective alternative with complete control over data.
3. Flexible Nextcloud Configuration
Hosting Nextcloud on cPanel while leveraging Ubuntu for storage maximizes the flexibility of the setup:
- External Storage Integration: Nextcloud seamlessly connects to the Ubuntu storage server via external storage plugins or protocols like WebDAV, SMB, or NFS.
- Redundancy and Backups: Data on the Ubuntu server can be backed up independently, providing an additional layer of security and disaster recovery.
- Workload Distribution: By separating the roles of application hosting and storage, each server is optimized for its specific function, improving overall reliability.
4. Why Thexyz for cPanel Hosting?
- Privacy-Focused Hosting: Thexyz provides secure and privacy-centric hosting, aligning perfectly with Nextcloud’s mission of empowering users to take control of their data.
- Renewable Energy: Hosting with Thexyz is environmentally responsible, as their services are powered by renewable energy.
- Support and Expertise: Thexyz offers dedicated support, ensuring any issues with the cPanel-hosted Nextcloud instance are resolved quickly.