I turn my company’s PC into my own “Vercel-like” platform

Duy Nguyen
4 min readJun 15, 2023

--

Why?

  • Because… why not? (it’s FREE, lol)
  • Utilize the power of my own PC to build web apps faster (with zero build time cost).
  • Kubernetes is hard & pushing developers to learn it even harder, well, I learned it so you don’t have to.
  • Unlike Vercel, with Kubernetes cluster, I (and my teammates) can deploy ANY apps.

Requirements

  • A computer (obviously!) with Ubuntu Server OS
    - Specification at least: 2 core, 4GB memory
    - Recommendation: 4 core, 8GB memory (because MicroK8S will take around 2,5GB of memory to run, but you will also need some for your applications)

(DigitalOcean has some droplets with good pricing tiers as well)

  • MicroK8S to spin up a Kubernetes cluster
  • Lastly, this magical open-source tool: Diginext
https://diginext.site

Architecture

In this case, I use my company’s PC (Ubuntu Server OS, 1TB SSD drive, 8 core, 32GB of memory)

Diginext Server Architecture

Install MicroK8S & deploy Diginext Server

curl -sfL https://diginext.site/install/microk8s | sh -

After it’s finished, you can try to access this URL: http://server-ip-address, if you can see the log in / sign up screen, then your cluster is ready!

For example: http://192.168.0.52

Create new account

Navigate to: http://server-ip-address then create a new account.

Diginext Server Login & Register Screen

Let’s create your first workspace

Give your workspace a name, then submit & you’re good to go.

Connect Diginext CLI to your workspace

To be able to deploy webapp to your MicroK8S cluster from your computer, you will need to install Diginext CLI and connect it to your Diginext workspace.

Open the terminal and install Diginext CLI with:

(If you don’t have Node.js 18+ installed, get it first)

npm i @topgroup/diginext --location=global

After it’s finished, you can use dx commands.

But first, let’s connect your Diginext CLI to the workspace:

dx login http://your-ip-address
# the browser will open up, copy & paste the access token here
# you will see a success message

Deploy a static webapp

  • Diginext Server need permissions to pull the git repository and start building, so let’s navigate to http://server-ip-address/git and connect your Bitbucket or Github account.
Connect Github account
Connect Docker Hub Registry
  • When it’s done, back to your Terminal and create a new app with dx new command & fill in the form:
    - Project: Hello World
    -
    App: Static Site
    -
    Framework: pick “Static Site Framework”
    -
    Git provider: select the one you have connected recently.
  • Navigate to the directory: cd ./helloworld-staticsite and you will see the source code of the framework, nothing special here, just a static html files and a Dockerfile
  • Deploy to our MicroK8S cluster using this command: dx up
    It will request the Diginext Server to pull the git repository of the webapp, then build the container image from the Dockerfile, and deploy it the MicroK8S cluster:
    - Cluster: pick “Default Cluster”
    -
    Use generated domain: YES
    -
    Port: 80
  • Now check out the link in the Terminal to see the build & deploy process, something like this:
Container build & deploy process
  • When it’s finished, click on the auto-generated link, you will see your web app now going live, woohoo!
Hello World Static HTML Site

👉 Since I have only set up this server for internal use, if you want to publish it on the internet, you may need to expose some ports on your internet router and configure traffic routing / security guards to your metal server. However, this is beyond the scope of this article.

What’s next?

Learn more about the stories of Diginext.

--

--

Duy Nguyen

Creator of Diginext - an open source app deployment & centralized cloud resource management platform