<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Fabien</title>
    <description>The latest articles on DEV Community by Fabien (@fabienmartin).</description>
    <link>https://dev.to/fabienmartin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3589333%2Fb47a130d-6ef8-4cd6-b3db-b475f05344e9.jpg</url>
      <title>DEV Community: Fabien</title>
      <link>https://dev.to/fabienmartin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fabienmartin"/>
    <language>en</language>
    <item>
      <title>How to set up your domain and TLS with PocketBase</title>
      <dc:creator>Fabien</dc:creator>
      <pubDate>Wed, 05 Nov 2025 13:52:36 +0000</pubDate>
      <link>https://dev.to/fabienmartin/how-to-set-up-your-domain-and-tls-with-pocketbase-20e0</link>
      <guid>https://dev.to/fabienmartin/how-to-set-up-your-domain-and-tls-with-pocketbase-20e0</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/fabienmartin/how-to-deploy-pocketbase-on-aws-with-docker-1o6g"&gt;Part 1&lt;/a&gt; we deployed PocketBase on AWS EC2 with Docker.&lt;/p&gt;

&lt;p&gt;Now, let’s put it behind NGINX and enable TLS certificates using Let’s Encrypt.&lt;/p&gt;

&lt;p&gt;Time: ~10–15 min.&lt;/p&gt;

&lt;p&gt;What this will cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Domain pointing to the server (api.example.com → )&lt;/li&gt;
&lt;li&gt;NGINX reverse proxy + Let’s Encrypt TLS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is the first in a four-part series on deploying and extending PocketBase.&lt;/p&gt;

&lt;p&gt;Here are the 4 articles:&lt;br&gt;
• &lt;a href="https://dev.to/fabienmartin/how-to-deploy-pocketbase-on-aws-with-docker-1o6g"&gt;Part 1: Deploy PocketBase on AWS with Docker&lt;/a&gt;&lt;br&gt;
• Part 2: Custom domain + free HTTPS (TLS) &amp;lt;= &lt;strong&gt;We are here&lt;/strong&gt;&lt;br&gt;
• Part 3: S3 storage, email setup, and automated backups&lt;br&gt;
• Part 4: Integrating Cloudflare Functions to handle advanced logic or external APIs, a faster way to extend PocketBase without modifying its core or waiting for rebuilds&lt;/p&gt;

&lt;p&gt;Once all four parts are live, you’ll have a complete, production-ready PocketBase setup with a clean path for future extensions.&lt;/p&gt;

&lt;p&gt;Deploying PocketBase manually is simple… until you do it three times.&lt;/p&gt;

&lt;p&gt;In this series, I’ll show the full manual setup and you will understand why it’s worth automating.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s9ffb1yihh8me9u950w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s9ffb1yihh8me9u950w.gif" alt=" " width="200" height="112"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Step 1: Point from your domain to PocketBase
&lt;/h4&gt;

&lt;p&gt;1 - Get your instance IP&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5oc0887xmph6wa7su8e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5oc0887xmph6wa7su8e.png" alt=" " width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2 - Go to your favorite DNS provider (Cloudflare, Porkbun, etc...) and create a new record &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkjn2izvl6m1pnao7u6oj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkjn2izvl6m1pnao7u6oj.png" alt=" " width="800" height="105"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3 - Test if the new record propagated already in your terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://pb.example.com:8080/api/health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should return: {"message":"API is healthy.","code":200,"data":{}}&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Get NGINX running!
&lt;/h4&gt;

&lt;p&gt;1 - Install NGINX&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install -y nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 - Create your NGINX config file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /var/www/certbot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo tee /etc/nginx/sites-available/pb.conf &amp;gt;/dev/null &amp;lt;&amp;lt;'NGINX'
server {
  listen 80;
  server_name pb.example.com;

  location ^~ /.well-known/acme-challenge/ {
    root /var/www/certbot;
  }

  location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    # WebSocket support
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;

    proxy_pass http://127.0.0.1:8080;
  }
}
NGINX
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/pb.conf /etc/nginx/sites-enabled/
sudo nginx -t &amp;amp;&amp;amp; sudo systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 - Test that PocketBase is accessible on the domain&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://pb.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 3: Enable HTTPS with Let's Encrypt
&lt;/h4&gt;

&lt;p&gt;1 - install certbot and run it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d pb.example.com --email you@example.com --agree-tos --redirect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 - Let's close the port from the previous tutorial&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssgdbccnc024yx8cc8z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssgdbccnc024yx8cc8z1.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6be9vj3lmrjigs5y5ze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6be9vj3lmrjigs5y5ze.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tjqjhluz4bt68fuvr8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tjqjhluz4bt68fuvr8a.png" alt=" " width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3 - Test it&lt;/p&gt;

&lt;p&gt;=&amp;gt; go to &lt;a href="https://api.example.com/_/" rel="noopener noreferrer"&gt;https://api.example.com/_/&lt;/a&gt; and use your login/password&lt;/p&gt;

&lt;p&gt;✅ You made it! Congrats! Next: Setup S3 Storage, Email and automated backup.&lt;/p&gt;

&lt;p&gt;Or skip setup entirely → deploy PocketBase in 20s with pbdeploy.&lt;/p&gt;

</description>
      <category>pocketbase</category>
      <category>nginx</category>
      <category>backend</category>
    </item>
    <item>
      <title>How to deploy PocketBase on AWS with Docker</title>
      <dc:creator>Fabien</dc:creator>
      <pubDate>Thu, 30 Oct 2025 16:42:29 +0000</pubDate>
      <link>https://dev.to/fabienmartin/how-to-deploy-pocketbase-on-aws-with-docker-1o6g</link>
      <guid>https://dev.to/fabienmartin/how-to-deploy-pocketbase-on-aws-with-docker-1o6g</guid>
      <description>&lt;p&gt;First, I’m a huge &lt;a href="https://pocketbase.io" rel="noopener noreferrer"&gt;PocketBase&lt;/a&gt; fan!&lt;/p&gt;

&lt;p&gt;I use it for many projects (e.g., &lt;a href="https://smartgoutcare.com" rel="noopener noreferrer"&gt;smartgoutcare&lt;/a&gt;) and to prototype fast.&lt;/p&gt;

&lt;p&gt;This guide shows how to deploy PocketBase 0.31 on AWS EC2 using Docker, complete with persistence and auto-restart.&lt;br&gt;
Perfect for indie devs and small apps that want a simple, production-ready backend.&lt;/p&gt;

&lt;p&gt;This tutorial is up-to-date for PocketBase v0.31 and tested on Ubuntu 24.04 LTS.&lt;/p&gt;

&lt;p&gt;Time: ~10–15 min. Cost: ~$0–$5/mo (t2.micro). &lt;/p&gt;
&lt;h6&gt;
  
  
  What this will cover:
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Create &lt;strong&gt;EC2&lt;/strong&gt; &amp;amp; assign &lt;strong&gt;Elastic IP&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;SSH in &amp;amp; install &lt;strong&gt;Docker&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;strong&gt;PocketBase container&lt;/strong&gt; (volume + restart policy)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post is the first in a four-part series on deploying and extending PocketBase.&lt;/p&gt;

&lt;p&gt;By the end of next week, I’ll publish:&lt;br&gt;
• Part 2: Custom domain + free HTTPS (TLS)&lt;br&gt;
• Part 3: S3 storage, email setup, and automated backups&lt;br&gt;
• Part 4: Integrating Cloudflare Functions to handle advanced logic or external APIs, a faster way to extend PocketBase without modifying its core or waiting for rebuilds&lt;/p&gt;

&lt;p&gt;Once all four parts are live, you’ll have a complete, production-ready PocketBase setup with a clean path for future extensions.&lt;/p&gt;

&lt;p&gt;Deploying PocketBase manually is simple… until you do it three times.&lt;/p&gt;

&lt;p&gt;In this series, I’ll show the full manual setup and you will understand why it’s worth automating.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F574djc20l9ovdyqpzyta.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F574djc20l9ovdyqpzyta.gif" alt="22 sec deployment" width="200" height="112"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h6&gt;
  
  
  Prerequisites
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;AWS account&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  Step 1: Create an EC2 Instance
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;In the AWS console, go to &lt;strong&gt;EC2 → Launch Instance&lt;/strong&gt;.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ipsy6nesnq7e8ykqjw1.png" alt="Press Launch Instance in the EC2 menu" width="800" height="377"&gt;
&lt;/li&gt;
&lt;li&gt;Choose your instance name and &lt;strong&gt;Ubuntu 22.04 LTS&lt;/strong&gt; (free-tier eligible). 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp37fitp96lqv53nqv8ug.png" alt="Choose your instance name &amp;amp; distribution" width="800" height="623"&gt;
&lt;/li&gt;
&lt;li&gt;Instance type: &lt;strong&gt;t2.micro&lt;/strong&gt; or larger &amp;amp; select (create if not done yet) your key pair.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimazbwkgptg5xgp2004r.png" alt="Choose t2.micro and create key pair" width="800" height="291"&gt;
&lt;/li&gt;
&lt;li&gt;Allow ports &lt;strong&gt;22, 80, 443&lt;/strong&gt;.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1euli6532ueduup5hr9f.png" alt="Allow http / https / ssh" width="800" height="470"&gt;
&lt;/li&gt;
&lt;li&gt;Launch Instance&lt;/li&gt;
&lt;li&gt;Got to Elastic IP menu, then allocate an &lt;strong&gt;Elastic IP&lt;/strong&gt; (this is very important in case your instance shut down, with Elastic IP you will keep the same IP, otherwise you will get a new random one that will screw up your DNS records)
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4648tqh32qm2mm509ig4.png" alt="Go to Elastic IPs" width="800" height="376"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fem3bnwwdylvta5m442ey.png" alt="Click on Allocate Elastic IP address" width="800" height="357"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gszybhezsvrrtl4moxv.png" alt="Get an IP" width="800" height="327"&gt;
&lt;/li&gt;
&lt;li&gt;Associate it with your instance
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5sz3lldux4g4uubyzem1.png" alt="Associate the IP with your instance" width="800" height="267"&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Step 2: Install Docker and run PocketBase
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Login into the instance 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9fzpnjse2yrxulidajed.png" alt="Connect menu" width="800" height="375"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fldmiismfse5aw8cph6sp.png" alt="Click on connect" width="800" height="295"&gt;
&lt;/li&gt;
&lt;li&gt;Install Docker (From Docker [install docs])(&lt;a href="https://docs.docker.com/engine/install/ubuntu/" rel="noopener noreferrer"&gt;https://docs.docker.com/engine/install/ubuntu/&lt;/a&gt;)
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 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

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;amp;&amp;amp; echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;They will ask you if you wanna install =&amp;gt; press Y&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create PocketBase image (There is no official Docker image, so let's build it)
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;And paste the following Dockerfile&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM alpine:3.20

ARG PB_VERSION=0.31.0
ARG TARGETOS=linux
ARG TARGETARCH=amd64

# Create unprivileged user
RUN addgroup -S pb &amp;amp;&amp;amp; adduser -S -G pb pb

# Basics
RUN apk add --no-cache ca-certificates tzdata curl unzip

# Install PocketBase
WORKDIR /pb
RUN curl -fL -o pb.zip \
    https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_${TARGETOS}_${TARGETARCH}.zip \
 &amp;amp;&amp;amp; unzip pb.zip -d /usr/local/bin \
 &amp;amp;&amp;amp; rm pb.zip \
 &amp;amp;&amp;amp; chmod +x /usr/local/bin/pocketbase

# Data dir
RUN mkdir -p /pb/pb_data &amp;amp;&amp;amp; chown -R pb:pb /pb
VOLUME ["/pb/pb_data"]

EXPOSE 8080
USER pb

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
  CMD curl -fsS http://127.0.0.1:8080/ &amp;gt;/dev/null || exit 1

ENTRYPOINT ["pocketbase","serve","--http","0.0.0.0:8080"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(To get out of nano: ctrl + X then Y then enter)&lt;/p&gt;

&lt;p&gt;Build the image&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker build -t pocketbase:0.31.0 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deploy PocketBase
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /srv/pocketbase

sudo mkdir -p /srv/pocketbase
sudo chown -R 100:101 /srv/pocketbase   # user:group inside container
sudo chmod -R u+rwX,g+rwX /srv/pocketbase

sudo docker run -d \
  --name pocketbase \
  -p 8080:8080 \
  -v /srv/pocketbase:/pb/pb_data \
  --restart always \
  pocketbase:0.31.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a superuser account
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker exec -it pocketbase /usr/local/bin/pocketbase \
  --dir /pb/pb_data \
  superuser create you@example.com StrongPass123!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Open 8080 temporarily
Here it is PocketBase is running. In order to have access to it until the next post, let's open the port 8080 to see it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmebk70rbm55tziabkkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmebk70rbm55tziabkkg.png" alt="go to security group" width="800" height="378"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nfi261h0fsc42v9fqs4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3nfi261h0fsc42v9fqs4.png" alt="click on edit inbound rules" width="800" height="356"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foldxsnne52g9cygkwi2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foldxsnne52g9cygkwi2k.png" alt="Add TCP / 8080 / 0.0.0.0/0 &amp;amp; save" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the IP &amp;amp; enjoy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7rzddkfeofj2bpjg7vr4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7rzddkfeofj2bpjg7vr4.png" alt="find the IP" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get the IP and go to http://:8080 &amp;amp; log in with your credentials.&lt;/p&gt;

&lt;p&gt;✅ You made it! Congrats! Next: Add a domain and HTTPS with Nginx and Certbot (Part 2).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Or skip setup entirely → deploy PocketBase in 20s with &lt;a href="https://pbdeploy.com" rel="noopener noreferrer"&gt;pbdeploy&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>pocketbase</category>
      <category>aws</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
