1minDocker #14 - Deploy an AI app with Docker on cloud

In the last article we dove into the world of continuous integration with GitHub Actions. Now it's time to take a step forward and to talk about deploying a Docker application and make it available to everyone. To do this, we could exploit a local server, but local servers are usually costly to set up, initialize and maintain (on the long run): cloud solutions are, on the other hand, simpler and faster to boot and set up, especially the one we are going to use for this tutorial, Linode Step 1: your Linode instance Setting up a Linode instance couldn't be easier: you just need to sign up or log in to Linode. Once you land into your dashboard, you just need to click on Create (green button on the top left corner) -> Linode . Then you will be prompted to select the settings of your instance (operating system, region, name, root password and, eventually, an SSH key). The set up is extremely intuitive and, for our application, I'd suggest: Choose Ubuntu 22.04 as OS Choose a 2GB RAM - 1 vCPU hardware Choose the region that is closer to you Choose a strong password for your root user Once you are set up and your instance is booted and running, you can connect to it from your terminal. Regardless that you are on Windows, macOS or Linux (although I prefer the last one), you can simply use the SSH protocol and authenticate with the root password. To do so, you need to get the public IP address of your Linode (which will be useful also later) - you can comfortably find it in you dashboard. ssh root@ You'll be prompted to input the password and, after that, you'll be finally inside your Linode's terminal! Step 2: preparing your Linode for the application Since we want to deploy our application with Docker, we need to install it within our Linode virtual machine. If you followed my advice and you created an Ubuntu 22.04 machine, you can simply try these commands, that you can also find on the official Docker installation page: # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc # Add the repository to Apt sources: echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update After this, run: sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Test the successful installation with: sudo docker run hello-world And BAM! You installed Docker

Mar 7, 2025 - 00:52
 0
1minDocker #14 - Deploy an AI app with Docker on cloud

In the last article we dove into the world of continuous integration with GitHub Actions. Now it's time to take a step forward and to talk about deploying a Docker application and make it available to everyone. To do this, we could exploit a local server, but local servers are usually costly to set up, initialize and maintain (on the long run): cloud solutions are, on the other hand, simpler and faster to boot and set up, especially the one we are going to use for this tutorial, Linode

Step 1: your Linode instance

Setting up a Linode instance couldn't be easier: you just need to sign up or log in to Linode.

Once you land into your dashboard, you just need to click on Create (green button on the top left corner) -> Linode . Then you will be prompted to select the settings of your instance (operating system, region, name, root password and, eventually, an SSH key). The set up is extremely intuitive and, for our application, I'd suggest:

  • Choose Ubuntu 22.04 as OS
  • Choose a 2GB RAM - 1 vCPU hardware
  • Choose the region that is closer to you
  • Choose a strong password for your root user

Once you are set up and your instance is booted and running, you can connect to it from your terminal. Regardless that you are on Windows, macOS or Linux (although I prefer the last one), you can simply use the SSH protocol and authenticate with the root password. To do so, you need to get the public IP address of your Linode (which will be useful also later) - you can comfortably find it in you dashboard.

ssh root@

You'll be prompted to input the password and, after that, you'll be finally inside your Linode's terminal!

Step 2: preparing your Linode for the application

Since we want to deploy our application with Docker, we need to install it within our Linode virtual machine.

If you followed my advice and you created an Ubuntu 22.04 machine, you can simply try these commands, that you can also find on the official Docker installation page:

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

After this, run:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Test the successful installation with:

sudo docker run hello-world

And BAM! You installed Docker