blog

Breathe New Life into Your Old PC with CasaOS: Build Your Own Home Server & Secure VPN

Got an old computer gathering dust? Transform it into a powerful home server! This guide walks you through setting up a secure file sharing system and a personal VPN using just your spare PC. No prior technical experience is required - we'll take it step-by-step.

Hosting your own server offers several benefits: complete control over your data, eliminate dependence on paid cloud storage or VPN services, and enjoy increased security and privacy. Imagine accessing your files from anywhere, securely sharing them with friends and family, and browsing the internet privately - all powered by your very own home server!

Here's what we'll cover:

  • Transforming your old PC into a powerful home server
  • Setting up secure file sharing using SMB protocol
  • Creating a personal VPN for enhanced security and privacy

Let's get started!


Step 1: Prepping Your Old PC

Before diving in, ensure your old computer is functioning properly. Give it a good cleaning, check hard drives for errors, and make sure all components are working. Consider adding more RAM or storage if possible.

Step 2: Installing Ubuntu Server

  1. Download the ISO: Visit the official Ubuntu website (https://ubuntu.com/) and download the latest server version. You'll need a USB drive with at least 8GB of storage.
  2. Create a Bootable USB: Use a tool like Rufus (for Windows) or Etcher (for Mac/Linux) to create a bootable USB drive from the downloaded ISO image.
  3. Boot from USB: Insert the bootable USB into your old PC and boot it up. You might need to adjust your BIOS settings to prioritize booting from USB.
  4. Follow Installation Instructions: Ubuntu Server will guide you through the installation process. Choose your language, keyboard layout, and network configuration, but make sure you configure the server with a static IP. You can also keep it on DHCP if you wish, but you should reserve the IP in your router, so the IP never changes. Select "Automatic partitioning" for a simplified setup.
  5. Need a Detailed Guide? If you’d like more step-by-step guidance, check out my detailed tutorial on Installing Ubuntu Server 24.04 on Bare Metal. This guide walks you through every part of the process, making it easy for beginners.

Step 3: Setting Up SSH Access

SSH (Secure Shell) allows remote access to your server. Enable it during the Ubuntu installation or later using the following command:

sudo apt update && sudo apt install openssh-server

After installation, you'll be able to connect to your server from another computer using an SSH client like PuTTY (Windows) or Terminal (Mac/Linux).

Step 4: Installing CasaOS & Updates

Update Packages: Open a terminal window and run the following commands:

sudo apt update && sudo apt upgrade

Install CasaOS: Use the provided command to download and install CasaOS:

curl -fsSL https://get.casaos.io | sudo bash

Step 5: Accessing the CasaOS Dashboard

Open your web browser and navigate to http://[your_server_IP_address]. You will be prompted to create an account on your first login, then you'll be greeted by the CasaOS dashboard, where you can manage your server settings and applications.

Step 6: Creating a Network Share with SMB

  1. Open Files App: From the dashboard, open the Files app.
  2. Create a Folder: Within the Files app, click on "Upload or create" and select "New folder", and give it a name like "Shares".
  3. Create a Share: Within the Files app, hover your mouse over the folder you want to share, click the three dots, then select "Share". Copy the appropriate path for your operating system.

Now you can access your shared folder from other devices on your network using the SMB protocol.

Step 7: Setting Up WireGuard VPN

Setting up WireGuard will allow you to securely connect to your home server from anywhere. Follow these steps to install and configure WireGuard:

  1. Install WireGuard on Your Server: Open the CasaOS app store, find the WireGuard app, and install it.
  2. Create a User Profile: In the WireGuard app on CasaOS, select "New" to create a VPN client profile. Enter a name for this profile, such as "HomeVPN," which you’ll use to connect from other devices.
  3. Set Up WireGuard on Your Devices:
    • Download the WireGuard app on each device you want to connect to your VPN (e.g., your laptop and smartphone).
    • Open the WireGuard app on your device and select the "+" button to add a new connection. Choose the "Scan QR Code" option.
    • Go back to CasaOS on your server, select "Scan QR Code" next to the user profile you created, and scan it with your device. This links your device to your server's VPN profile.
  4. Configure Port Forwarding on Your Router: Log in to your router’s settings and create a new port forwarding rule to forward traffic on port 51820 (UDP) to your server’s IP address. This allows external connections to reach your VPN.
  5. Find Your Public IP Address: Visit a site like ipchicken.com to check your public IP address. Write this down, as you’ll need it to configure WireGuard on your device.
  6. Edit Your Device’s VPN Settings: In the WireGuard app on your device, open the VPN profile you created earlier by selecting the pencil icon to edit the settings. Update the "Endpoint" field with your public IP address, followed by “:51820” (e.g., 123.45.67.89:51820). This will direct your device to connect to your server.

Step 8: Connect & Enjoy!

Once configured, connect your client device to the WireGuard VPN. Now, all your internet traffic will be routed through your home server, providing enhanced security and privacy.

Congratulations! You've successfully set up your own personal home server with file sharing and a secure VPN.