Careers and getting hired · Intermediate · 16 min
Build an infrastructure portfolio from a home lab
By Padding · Updated 18 Nov 2026
GitHub and any small server · November 2026
You will have one public repository that builds a small server from code, deploys an app through a pipeline, monitors it and documents a failure you rehearsed, with a diagram, a cost note and a README a stranger can rebuild from.
On this page
Infrastructure work is mostly invisible when it goes well. A hiring manager for a junior DevOps, cloud or platform role cannot see that you "know Linux" or "understand CI/CD" from a list on a CV. They can see a repository where one command builds a server, a pipeline that deploys to it, a graph that shows it is healthy, and an honest account of the time it broke.
This tutorial turns the practice you already have into that evidence. You will build one project, end to end, on hardware you can afford, and write it up so a stranger can rebuild it. It is not a new technical course: each step points to the Padding tutorials that teach the tool, and spends its words on the decisions and the write-up that make the project read like work.
The example follows Amara, an IT support technician in Abuja who is aiming at a junior DevOps role. Her project is a small status page for the community radio station where she volunteers, so presenters can see whether the stream server is up. Yours can be anything small with a real user: the rule from pick portfolio projects that show you can do the job still applies.
The finished repository has six parts, and each step below produces one of them:
- A lab note: what the project runs on, what it costs and its limits.
- Code that builds the server from nothing.
- A pipeline that deploys the app on every merge.
- Monitoring with at least one alert.
- A post-incident write-up of a failure you caused on purpose.
- A README with an architecture diagram and a cost note.
Step 1 · Choose your lab and write down its limits
Pick the cheapest machine that can run a Linux server for a month. You need one host, not a cluster. A reviewer is more impressed by one server that is rebuilt from code and monitored than by five that were clicked together.
The three usual options:
- An old laptop or desktop. No monthly bill and full control. It sits behind your home router, so the public cannot reach it without port forwarding or a tunnel, and it goes down when the power does. Install Ubuntu Server on it and treat it as disposable.
- One small VPS. A public IP address, a data centre that keeps it powered, and the closest match to how companies run servers. Choose the smallest plan that has at least 1 GB of memory, and set a calendar reminder to delete it when the project ends.
- A cloud free tier. Useful if you want a cloud provider's name on the project. Read the limits before you design around them. Oracle Cloud's Always Free tier, for example, currently gives an Always Free tenancy Arm capacity equivalent to 2 OCPUs and 12 GB of memory, plus up to two small AMD instances with 1 GB of memory each, and it may reclaim instances it considers idle. Other providers' free offers change often and some are time-limited, so check the provider's own page on the day you sign up and write the date down.
Whichever you choose, start a repository now, public, with a short name that says what it does (Amara's is radio-status-lab). Create a file docs/lab.md and write four lines in it: the machine (model or plan, CPU, memory, disk), the operating system and version, what it costs per month or "no monthly cost", and its limits (no public IP, power cuts, 1 GB of memory, free tier may reclaim idle instances).
In Nigeria and across Africa
Power and data shape the choice. A home laptop with a battery rides out short cuts, but a long outage will take the lab down, so a home lab suits learning more than a public demo. A VPS costs money in a foreign currency, so check that your bank card works for international online payments before you rely on a provider, and watch the exchange rate when you plan a budget. If you are on prepaid mobile data, do heavy downloads (operating system images, container images) once, on Wi-Fi if you can, and keep them. None of this is a weakness in a portfolio: writing down how you designed around an unreliable power supply or a tight data budget is the kind of constraint reviewers recognise from real operations work.
Check it worked
Your repository exists and is public, and docs/lab.md names the machine, the operating system with its version, the monthly cost and at least two limits. If you used a free tier, the limits you wrote come with the provider's page and the date you checked it.
Step 2 · Set the repository up so secrets never go in
Do this before you write any infrastructure code, because a public repository shows its whole history, not just the latest commit. A password deleted in a later commit is still in the history, and copies can survive in clones and forks even if you rewrite it. If a secret does get pushed, the first job is to revoke or rotate it, not to hide the commit.
Set up these defences:
- A
.gitignorewritten first. Ignore.env, any*.tfvarsfile that holds real values, OpenTofu or Terraform state files, private keys and your Ansible inventory if it holds real addresses. Keep secrets out of Git walks through the patterns. - An example file in place of the real one. Commit
.env.examplewith every variable name and a fake or empty value, and a comment saying where the real value comes from. Code reads real values from environment variables, never from a file in the repository. - Pipeline secrets in GitHub, not in YAML. The SSH key and host address your deploy job needs go in the repository's Actions secrets, and the workflow refers to them by name.
- No account identifiers in public files. Cloud account IDs, your home IP address, your real domain's admin email and the server's IP address are not passwords, but they help an attacker and they tie the repository to you in ways you may not want. Use placeholders such as
203.0.113.10(an address range reserved for documentation) and say in the README which value to replace. - Push protection left on. GitHub's push protection for users is on by default and stops many known secret formats being pushed to public repositories. Treat it as a safety net, not the plan; it only knows the patterns it knows.
Then add a scanner you run yourself. Scan a repository for leaked secrets with Gitleaks shows how to scan the full history and how to run the same check in your pipeline, so every pull request is checked.
Check it worked
Your repository has a .gitignore that covers environment files, state files and keys, and a .env.example with names but no real values. Your Actions secrets page lists the secrets the deploy job will use. A scan of the full history with your secret scanner reports no findings.
Step 3 · Build the environment from code
The core claim of the project is "I can rebuild this from nothing". Pick one tool for it and use it properly, instead of a little of several:
- Ansible if your lab is a laptop or an existing VPS: the machine exists, and a playbook makes it into your server. Start with configure a server with an Ansible playbook.
- OpenTofu with cloud-init if your lab is a cloud instance: code creates the machine, and cloud-init user data configures it on first boot. Start with manage infrastructure with OpenTofu.
The code should leave the server in the state the first-production-server series builds by hand: a sudo user that logs in with a key, password login off, a firewall that allows only SSH and web traffic, automatic security updates, a web server or reverse proxy, and your app's runtime. That series is the checklist; your code is the automated version of it.
Keep one documented entry point. A reader should run one command (ansible-playbook site.yml, or tofu apply) after filling in one variables file from its example. If you need a step that is not in code, such as creating a DNS record by hand, write it in the README as a numbered manual step and say why it is manual.
Then prove the claim. Wipe the machine (reinstall the operating system, or destroy and recreate the instance) and run your code again. Time it. Anything that fails the second time is a hidden manual step you did the first time; fix the code until a clean run works.
Amara's Ansible playbook took 40 minutes the first time she rebuilt her laptop, because she had installed a package by hand weeks earlier and forgotten. She added it to the playbook and wrote the rebuild time, 9 minutes, in her README.
Check it worked
You have wiped and rebuilt the server at least once from your code alone, following your own README. The README states the one command to run, the file to fill in first, any manual steps with a reason, and how long a rebuild took.
Step 4 · Deploy the app through a pipeline
Keep the app small. A static status page, a tiny API or a single container is enough; the subject of this project is how the app gets to the server and stays up, not the app. Amara's status page is one HTML file plus a small script that checks the stream server's port every minute and writes the result.
Write a GitHub Actions workflow with two jobs:
- Check. Runs on every pull request: lint the infrastructure code, run the app's tests if it has any, and run the secret scan from Step 2. Your first GitHub Actions workflow covers the workflow file itself.
- Deploy. Runs only when a change is merged to the main branch, after Check passes. It connects to the server over SSH with a key stored as an Actions secret, copies the new version and restarts the service. Deploy to a server over SSH with GitHub Actions shows a safe way to do it, with a dedicated deploy user that can do only what the job needs.
Standard GitHub-hosted runners are free in public repositories, so a public portfolio project does not need a paid plan for this. A home lab behind a router is not reachable from GitHub's runners; either expose SSH through a tunnel you understand and can explain, or run a self-hosted runner on the lab machine and say in the README why you chose it.
Make the deploy visible. Show the commit hash or a version number on the page or in a /version response, so anyone can see which commit is live.
Check it worked
Open a pull request that changes a visible line of text. The Check job runs on the pull request and passes. After you merge, the Deploy job runs, and the live page shows the new text and the new commit hash within a few minutes. The Actions tab shows both runs, and you link to them in the README.
Step 5 · Monitor it and set one alert
A service nobody watches is half-finished. Add monitoring that answers two questions: is it up, and is the machine healthy?
The pattern from monitor a server with Prometheus and Node Exporter is a good fit: Node Exporter for CPU, memory and disk, Prometheus to collect them, and a Grafana dashboard to show them. Install all of it from the same code as Step 3, so a rebuild brings the monitoring back too. If 1 GB of memory is too tight for the full stack, monitor from a second free machine or keep to Node Exporter and a simple external uptime check, and write that trade-off down.
Then add one alert that matters, with a threshold you can explain. Good first alerts: the site has not answered for two minutes; the disk is more than 85 per cent full; the service has restarted three times in ten minutes. Send it somewhere you will actually see, such as an email or a chat channel, and never commit the webhook address or mail password; it goes in the same secret store as everything else.
Take one screenshot of the dashboard with real data, cropped to your own panels, for the README.
Check it worked
The dashboard shows at least a day of data for CPU, memory and disk. You have made the alert fire on purpose (stop the service, or fill a test file on the disk) and received the message where you said it would arrive, then seen it clear when you fixed the cause.
Step 6 · Break it on purpose and write the post-incident review
This is the part most junior portfolios leave out, and the one that reads most like the job. Choose one realistic failure, cause it, recover from it, and write it up as if it had happened at work.
Pick a failure you can cause safely and undo:
- The disk fills up because logs are not rotated.
- A deploy ships a broken config and the service will not start.
- The SSH key used by the pipeline is rotated and deploys fail.
- The machine is rebooted (or loses power) and the app does not come back.
Before you start, write down what you expect the monitoring to show and how long recovery should take. Then cause it, note the time of each thing you see and do, recover, and write docs/incidents/2026-11-<day>-<short-name>.md with these headings:
- Summary. Two sentences: what broke, for how long, and who would have been affected.
- Timeline. Times and events, from the cause to "fully recovered". Include when the alert fired, or that it did not.
- Detection. How you found out. If the alert missed it, say so; that is a finding, not a failure of the write-up.
- Cause. The technical cause, and the condition that let it happen (no log rotation, no config check before restart).
- Recovery. The exact steps you took.
- What changed. The fixes you made in the repository afterwards, each with a link to the commit or pull request.
Write it blamelessly: describe what the system allowed, not who made a mistake, even though the "who" was you. That habit is what teams look for. If you want a template the whole team could use, write an incident response plan for a small team covers the wider process.
Amara rebooted her laptop to simulate a power cut. The page came back, but the stream check did not, because its service was not enabled to start on boot. Her alert fired after two minutes. Her "What changed" section links the one-line playbook fix and a new check in the pipeline that fails if any service in the playbook is not enabled.
Check it worked
Your repository has one incident file with all six headings filled in, a timeline with real times, and at least one "What changed" item linked to a merged commit or pull request. You have caused the same failure again after the fix and seen it handled.
Step 7 · Draw the diagram and write the cost note
A reviewer should understand the system in under a minute. Draw one architecture diagram with no more than eight boxes: the reader's browser, the server and the main services on it, GitHub Actions, the monitoring and where alerts go. Draw arrows for traffic and deploys, and label each arrow with what crosses it (HTTPS on 443, SSH deploy, metrics scrape). Use any diagram tool that exports SVG or PNG, or Mermaid in the README itself, which GitHub renders.
Then write a short cost note in the README, under "What this costs to run":
- The monthly cost of each paid part, with the date you checked it, or "free tier" with the limit that applies.
- What would change the cost if this served a real organisation: more memory, a second server for failover, backups stored somewhere else, a managed database.
- What you did to keep cost down, such as one small server, free CI for public repositories, deleting the instance when it is not needed.
Cost awareness is part of infrastructure work, and a junior who can say "this runs on one 1 GB server, and here is what doubling the traffic would cost" stands out.
Check it worked
The README shows a diagram in which every box and arrow is labelled, and a stranger can name the path a request takes from the browser to the app. The cost note lists every paid part with a date, or names the free-tier limits that apply.
Step 8 · Write the README for a hiring manager and test it on a stranger
The README is the first thing a visitor to the repository sees, so write it for two readers: a hiring manager with three minutes, and an engineer who wants to rebuild it. Put the first reader first:
- One paragraph at the top. Who it is for, what it does, and what it shows: "Builds a monitored Ubuntu server for a community radio station's status page from Ansible, deploys on merge with GitHub Actions, and includes a rehearsed outage write-up."
- The diagram.
- Evidence links. The latest Deploy run, the dashboard screenshot, the incident write-up, the rebuild time.
- Decisions. Three or four short paragraphs on choices you made and why: Ansible rather than OpenTofu, a self-hosted runner rather than a tunnel, the alert threshold you chose.
- Rebuild it. Prerequisites, the file to copy and fill in, the one command, manual steps, how to check it worked and how to tear it down.
- Cost note and limits.
Then test it. Ask someone who has not seen the project, ideally a person learning the same skills, to rebuild it on their own machine from the README alone, while you stay silent. Every question they ask is a gap in the README. Fix each one. Finally, scan the full history for secrets once more and check that no real IP address, account ID or email appears in any file or commit message.
Link the repository from your CV's projects section, using the problem and skill lines from write a tech CV that gets read. In an interview, the incident write-up is your best story: be ready to walk through it in two minutes.
Check it worked
A person other than you has rebuilt the environment from the README without your help, and you have fixed every gap they found. A full-history secret scan reports nothing, a search of the repository for your real server address and account IDs finds nothing, and the top of the README states the project, the evidence links and the rebuild command.
Next steps
Grow the same repository rather than starting a new one: add backups with automate and test restic backups with a systemd timer and write up a restore test as a second incident, or move the app into containers with deploy and expose an app on Kubernetes. If you want a cloud provider's name on your CV, the build an AWS environment with OpenTofu series takes the same ideas further.
For the rest of the job search, prepare for each stage of a tech interview shows how to use a project like this in a technical interview.
Related tutorials
- Pick portfolio projects that show you can do the jobYou will turn the skills in real job adverts into a shortlist of two or three four-week portfolio projects, each with a named user or data source, a one-line problem and the skill it proves.
- How to Create Your First GitHub Actions WorkflowYou will write a workflow file that runs on every push and every pull request, check its syntax on your own computer with actionlint, push it, and read the run on GitHub.
- How to Deploy to Your Server over SSH from GitHub ActionsYou will set up a deploy key that can only do one thing on your Ubuntu 26.04 server, store it as an encrypted GitHub environment secret, and write a workflow that uploads each release over SSH and switches to it with a single atomic step.
Need this done for you?
Padding does this work for growing companies, from the first diagnosis to a system that keeps working.
Get new tutorials