Menu Zamknij

Running Your Own Self-Hosted Services on Ubuntu: The Ultimate DIY Power Move

In today’s world, everyone’s relying on some cloud service for email, file storage, and even streaming. But what if you could ditch the big tech companies and run your own services? Enter Ubuntu, the gateway to self-hosting freedom. Hosting your own services on Ubuntu is like building your own little slice of the internet—private, customizable, and all under your control.

Imagine having your own cloud, your own media server, or even hosting websites, all from that PC gathering dust in the corner. Sounds fun? Let’s dive into the awesome world of self-hosted services on Ubuntu, and how you can set them up for a truly DIY, privacy-first experience.


Why Self-Host?

Why bother hosting your own services when you’ve got Google, Dropbox, or Netflix? Here’s why:

  • Privacy: Your data stays on your server, not some distant cloud server.
  • Cost Savings: Why pay for cloud storage or streaming subscriptions when you can do it yourself for free (or nearly free)?
  • Customization: You get to configure services exactly how you want. No annoying limits, no extra fees for “premium” features.
  • Control: Want to increase your storage? Need a specific feature? You’re the boss. Upgrade or tweak your server however you see fit.

Ready to take back control? Let’s get started with some basic services you can run on your Ubuntu server.


Step 1: Set Up Ubuntu for Self-Hosting

Before we dive into the fun stuff, you need a machine running Ubuntu. Whether it’s a spare laptop, a Raspberry Pi, or a virtual machine, Ubuntu is a rock-solid choice for self-hosting.

Basic Setup:

  1. Install Ubuntu Server: Download Ubuntu Server from the official website, burn it to a USB stick, and install it on your machine.
  2. Update Your System: Once installed, make sure everything is up to date:
   sudo apt update && sudo apt upgrade -y
  1. Static IP: Set up a static IP address for your server so it’s easier to access remotely.
  2. Install SSH: Use SSH to manage your server remotely:
   sudo apt install openssh-server

With your Ubuntu server up and running, it’s time to install the self-hosted services that’ll make you feel like a true internet overlord.


Service 1: Personal Cloud with Nextcloud

Tired of using Google Drive or Dropbox? Nextcloud is an open-source cloud platform that you can host yourself. It’s perfect for file storage, sharing, and even document collaboration, and the best part? You control it all.

Installing Nextcloud:

  1. Install Apache, PHP, and MariaDB:
   sudo apt install apache2 mariadb-server libapache2-mod-php php php-mysql php-xml php-mbstring php-zip php-gd
  1. Create a Database for Nextcloud:
   sudo mysql -u root
   CREATE DATABASE nextcloud;
   CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'yourpassword';
   GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost';
   FLUSH PRIVILEGES;
   EXIT;
  1. Download Nextcloud:
   wget https://download.nextcloud.com/server/releases/nextcloud-21.0.0.zip
   sudo unzip nextcloud-21.0.0.zip -d /var/www/
  1. Configure Apache:
   sudo nano /etc/apache2/sites-available/nextcloud.conf

Add the following configuration:

   <VirtualHost *:80>
     DocumentRoot /var/www/nextcloud/
     ServerName yourdomain.com

     <Directory /var/www/nextcloud/>
        Require all granted
        AllowOverride All
        Options FollowSymLinks MultiViews
     </Directory>
   </VirtualHost>

Then, enable the config and restart Apache:

   sudo a2ensite nextcloud.conf
   sudo a2enmod rewrite headers env dir mime
   sudo systemctl restart apache2
  1. Access Nextcloud: Open your browser, visit http://yourserverip, and complete the setup.

Boom! You’ve got your own personal cloud, fully under your control. You can access it from your phone, tablet, or desktop, just like Google Drive—except this time, you are the cloud.


Service 2: Stream Your Media with Jellyfin

Forget paying for Netflix or Plex—Jellyfin is the open-source media server that lets you host and stream your own movies, TV shows, and music. Best of all, it’s completely free and easy to set up on Ubuntu.

Installing Jellyfin:

  1. Install Jellyfin:
   sudo apt install apt-transport-https
   wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | sudo apt-key add -
   echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/jellyfin.list
   sudo apt update
   sudo apt install jellyfin
  1. Start Jellyfin:
   sudo systemctl start jellyfin
   sudo systemctl enable jellyfin
  1. Access the Jellyfin Web Interface: Go to http://yourserverip:8096 and follow the setup process to add your media libraries.

Now, you can stream all your movies and shows to any device in your home—no subscriptions required. Jellyfin works on smart TVs, phones, and even gaming consoles, making it an awesome self-hosted alternative to big streaming services.


Service 3: Host Your Own Website with WordPress

Ready to be your own webmaster? Hosting a WordPress site on your Ubuntu server gives you the freedom to run a personal blog, portfolio, or even a business website without relying on expensive hosting platforms.

Installing WordPress:

  1. Install LAMP Stack:
   sudo apt install apache2 mariadb-server php php-mysql libapache2-mod-php
  1. Create a Database for WordPress:
   sudo mysql -u root
   CREATE DATABASE wordpress;
   CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'yourpassword';
   GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
   FLUSH PRIVILEGES;
   EXIT;
  1. Download WordPress:
   wget https://wordpress.org/latest.tar.gz
   sudo tar -xvzf latest.tar.gz -C /var/www/
   sudo chown -R www-data:www-data /var/www/wordpress
  1. Configure Apache for WordPress:
   sudo nano /etc/apache2/sites-available/wordpress.conf

Add the following configuration:

   <VirtualHost *:80>
     DocumentRoot /var/www/wordpress
     ServerName yourdomain.com

     <Directory /var/www/wordpress/>
        AllowOverride All
     </Directory>
   </VirtualHost>

Enable the config and restart Apache:

   sudo a2ensite wordpress.conf
   sudo systemctl restart apache2
  1. Complete WordPress Setup: Open your browser, go to http://yourserverip, and finish the setup wizard.

Congratulations! You’re now hosting your own website without paying a dime for third-party hosting services. Customize it, install plugins, and build your online presence just the way you like.


Bonus: Automating Backups with Restic

No self-hosted setup is complete without a solid backup plan. Restic is an easy-to-use backup tool that supports encryption and can be set to automatically back up your important files, databases, and more.

Installing Restic:

sudo apt install restic

Setting Up a Backup:

Create a backup repository and run your first backup:

restic init --repo /path/to/backup
restic -r /path/to/backup backup /var/www/nextcloud /var/www/wordpress

You can even automate this process with cron jobs to make sure your data is always safe.


Final Thoughts: Taking Control of Your Digital Life

By self-hosting services on Ubuntu, you’re taking control of your data, privacy, and digital life. Whether it’s your own cloud storage with Nextcloud, streaming media through Jellyfin, or running a personal website, self-hosting gives you freedom, customization, and peace of mind.

So why rely on big tech when you can run everything yourself? Grab an old PC or set up a cloud instance, install Ubuntu, and start building your own private internet empire!

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *