Deploy Fullstack in Vps 💪

Last time, I wrote about deploying a static web application on a VPS via Portainer.

This article summarizes the knowledge I gained from deployment a full-stack web application on a VPS via Portainer.

Table of contents

Insights

docker-compose.yaml

Unknown Error

Insights

1. Building a Dockerfile Requires a Local Build File

Building a Dockerfile requires the application’s build file to be in the root directory.

I spent a day connecting to the Docker container over SSH from the VPS 🥺

To manage version control for my blog posts, I wanted to enable Git over SSH in the directory where I store them, making version control easier to handle.

In the end, I spent a day troubleshooting an issue caused by a misconfiguration in the VPS that prevented me from connecting to the Docker Container hosting Gitea.

My initial configuration

I generated ssh-key then placed it in the .ssh/ directory in the VPS.

I got malware 🥶

One day I noticed that the app I deployed on my VPS was getting too heavy…

I typed the top command to see ongoing tasks.

$ top

Then I found an unknown service named kinsing

What is Kinsing ?

Kinsing is a kind of malware.

Malware is the name given to software aimed at malicious activity.

What is the purpose of Kinsing ?

Kinsing`s main objective is to mine bitcoins by occupying resources such as CPU and memory.

Deploy app in VPS via Portainer 🤩

updated at Sat, Mar 15, 2025

What is Portainer ?

Portainer is a GUI-based tool for managing Docker.

I’d like to host projects using Docker on a VPS, and Portainer makes maintenance much easier.

Table of contents

1. Prerequest

2. Prepare a source code

3. Register Image to GHCR

4. Create a container by Portainer

5. My trouble shooting

1. Prerequest

  • VPS
    • Portainer is deployed
  • Docker
  • Github account

2. Prepare a source code

Create a directory in VPS

I almost lost the data of my Portainer 😨

What happend

After updating Portainer, I noticed that my account and related data were lost.

Why it happend

I updated Portainer to the latest version following the official documentation.

I’ll show you how I set up Portainer in VPS.

I ran the following command:

docker run -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer-ce:latest

To update Portainer, I stopped the container and then removed it. After that, I ran the same command I used previously to create the container, which started the updated version.

About VPS 🤹

Easy-to-understand overview of VPS

VPS = Virtual Private Server

Let’s say that VPS is like renting apartment. By paying fee, we can get individual space in a building based on the shared infrastructure like water supply and gas.

Advantages

Using the analogy of an apartment to illastrate the advanteges.

  1. We can set up living system in lower cost compare to buying a house.
  2. We don’t affected so much by other neighbors because each rooms are separated.
  3. We can custamize the interior.
  4. We can apply things like air-conditioner, wifi which requires the contract.

Translating those in terms of technology,

Infrastructure of my blog site 🗼

※updated Mars 13 ,2025

In the last article I explained how I built my blog. Actually, since this was my first project using a VPS, I’d like to briefly note about the overview of the infrastructure.

1. Hosting the system on a VPS

※VPS = Virtual Private Server

Connected my local environment to the VPS via SSH.

2. Setting up Docker and Portainer

Installed Docker and Portainer on the VPS.