Blog
Welcome to the blog!
My Journey: Setting Up a Raspberry Pi 5, Installing Ubuntu, Migrating Laravel, and Hosting My Portfolio
My Journey: Setting Up a Raspberry Pi 5, Installing Ubuntu, Migrating Laravel, and Hosting My Portfolio
Ever since I got my hands on the Raspberry Pi 5, I knew I wanted to use it for something meaningful—not just tinkering, but actually running a real-world project. I’ve always liked the idea of hosting my own applications at home, so I decided to turn the Pi into a tiny but powerful server. In this post, I’ll share my experience setting up Ubuntu, configuring a LAMP stack, migrating my Laravel applications from version 7 to 12, and finally hosting my portfolio site on it.
Step 1: Installing Ubuntu on the Raspberry Pi 5
The first thing I did was flash Ubuntu Server onto an SD card. I then transferred the boot disk to a NVME. I went with the 64-bit version since Laravel and PHP tend to run better with it. Once I plugged in the Pi, it booted up smoothly, and I was greeted with the usual login screen.
From there, I updated the system:
sudo apt update && sudo apt upgrade -y
This gave me a clean, up-to-date environment to work with.
Step 2: Setting Up the LAMP Stack
To run Laravel, I needed PHP, MySQL (or MariaDB), and Apache. Installing them on Ubuntu was straightforward:
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql -y
I double-checked the PHP version since Laravel 12 requires PHP 8.1 or higher. Luckily, Ubuntu 22.04 ships with a recent enough version.
Then I enabled Apache’s rewrite module (needed for Laravel routes):
sudo a2enmod rewrite
sudo systemctl restart apache2
Step 3: Migrating Laravel Applications (7 → 12)
This turned out to be the toughest part of the entire project. I wasn’t just bumping version numbers—I quickly discovered that my original knowledge base application, which I had built years ago on Laravel 7, wouldn’t run smoothly with Laravel 12 at all.
At first, I tried the “normal” upgrade path by following Laravel’s official upgrade guides one version at a time:
- Updating composer.json dependencies
- Switching from older authentication scaffolding to Laravel Breeze
- Refactoring controllers and middleware that relied on deprecated methods
- Adjusting Eloquent queries to match the newer API changes
But the deeper I went, the clearer it became that my knowledge base app was built on patterns that simply didn’t translate well to modern Laravel. The authentication logic was outdated, the way I handled permissions didn’t line up with Laravel’s new authorization features, and my blade templates were tied to Bootstrap 4-era conventions. Even the database migrations needed serious attention, since I had some custom pivot tables that were messy and hard to maintain.
In short: the upgrade wasn’t just an upgrade—it was basically a rewrite.
So I started fresh with a brand-new Laravel 12 project and rebuilt the knowledge base application piece by piece:
- Authentication & roles – I used Laravel Breeze as the foundation, then layered in policies and gates for role-based access, replacing the clunky checks I had written years ago.
- Database & models – I cleaned up the schema, reorganized relationships, and embraced modern Eloquent practices like attribute casting and accessors.
- Frontend – I rewrote the Blade views using TailwindCSS (which ships nicely with Breeze), giving the whole app a cleaner, faster, and more maintainable UI.
- Search & filtering – Instead of the messy old search queries, I implemented Laravel Scout with a local search driver to make articles instantly searchable.
It was a lot of work, but by the end, my knowledge base app felt completely reborn. Not only was it running on Laravel 12, but it was also cleaner, faster, and easier to maintain than ever before.
When I finally saw the application load properly in the browser—on the Raspberry Pi, no less—it was a massive moment of relief. The rewrite wasn’t planned, but in hindsight, it was the best decision.
Step 4: Hosting My Portfolio
With Laravel working, I wanted to serve my personal portfolio from the Pi. I created a new virtual host in Apache:
sudo nano /etc/apache2/sites-available/portfolio.conf
I pointed the document root to my Laravel project’s public folder, then enabled the site:
sudo a2ensite portfolio.conf
sudo systemctl reload apache2
I also set up Let’s Encrypt with Certbot to get HTTPS running. Nothing feels more satisfying than seeing my site load securely in the browser—knowing it’s all powered by a Raspberry Pi on my desk.
Final Thoughts
What started as a simple experiment turned into a full-on self-hosted deployment. The Raspberry Pi 5 handled Ubuntu and the LAMP stack like a champ, and now I have my Laravel apps upgraded and running smoothly on it.
Hosting my portfolio this way makes it feel extra personal—like my projects aren’t just floating around in the cloud but actually living on hardware I can touch. It was definitely a learning experience, and I’d encourage anyone with a Pi to try turning it into their own tiny server.

Finally up and running and in a nice little case.