Skip to content

Commit

Permalink
Spelling and formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
svenja11 committed Aug 5, 2024
1 parent b07f712 commit bb92bef
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 47 deletions.
82 changes: 35 additions & 47 deletions tutorials/deploy-a-pocketbase/01.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
SPDX-License-Identifier: MIT
path: "/tutorials/deploy-a-pocketbase"
slug: "deploy-a-pocketbase"
date: "2024-07-25"
title: "Deploy a PocketBase"
date: "2024-08-05"
title: "Deploy PocketBase"
short_description: "This tutorial provides a detailed guide for deploying a production-scale PocketBase instance."
tags: ["Database", "Ubuntu"]
author: "Illia Shmelov"
Expand All @@ -12,8 +12,8 @@ author_img: "https://avatars.githubusercontent.com/u/129096750"
author_description: ""
language: "en"
available_languages: ["en"]
header_img: "header-x"
cta: "product"
header_img: "header-8"
cta: "cloud"
---

## Introduction
Expand All @@ -24,100 +24,81 @@ PocketBase is a powerful and flexible backend solution that offers real-time dat

Before you begin, ensure you have the following:

* A Hetzner Account: [Sign up](https://accounts.hetzner.com/signUp) at Hetzner.
* 1 server with Ubuntu 24.04
* You can use an Arm64 instance to get better performance compared to traditional x86 instances.
* Root access
* Basic Knowledge of Linux Command Line.

## Step 1 - Deploy a New Server
## Step 1 - Prepare Your Server

Log in to the [Hetzner Cloud Console](https://console.hetzner.cloud).
Use an SSH client (PuTTY or Terminal) to connect to your server:

Create a new project if needed.

Click on "Add Server" and choose the server type (CX22 or higher recommended).

**Note**: If you are comfortable with using ARM64 architecture, you can choose ARM64 instances to get better performance for the same price compared to traditional x86 instances.

Choose a data center location.

Select the image (Ubuntu 24.04 LTS is highly recommended).

![deploy-a-new-server](images/deploy-a-new-server.png)

Configure server specs and SSH keys.

Click "Create & Buy Now".

## Step 2 - Connect to Your Server

Use an SSH client (PuTTY or Terminal) to connect:

```console
```bash
ssh root@<your_server_ip>
```

## Step 3 - Prepare Your Server

Start by updating your server with the following commands:

```console
```bash
apt update && apt upgrade -y && apt install -y unzip
```

Next, create a user for PocketBase with this command:

```console
```bash
adduser pocketbase
```

You'll be prompted to enter a secure [password](https://www.random.org/passwords). Follow the on-screen instructions to complete the setup.

![prepare-your-server](images/prepare-your-server.png)

Now, switch to the new user by running:

```console
```bash
su - pocketbase
```

## Step 4 - Download PocketBase
## Step 2 - Download PocketBase

Visit the [PocketBase releases page](https://github.com/pocketbase/pocketbase/releases) and select the latest release. Choose the appropriate build for your instance - either linux_amd64 or linux_arm64. Copy the download URL, and use wget to download the file.
Visit the [PocketBase releases page](https://github.com/pocketbase/pocketbase/releases) and select the latest release. Choose the appropriate build for your instance either `linux_amd64` or `linux_arm64`. Copy the download URL, and use wget to download the file.

```console
> Run this command to check if you have an amd64 instance or an arm64 instance.<br>
> `[[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64"`
```bash
wget <url>
```

To unzip the downloaded archive, use the following command:

```console
```bash
unzip <filename>
```

**Tip**: If you need to check the filename, you can list the files in the directory with:

```console
```bash
ls
```

![download-pocketbase](images/download-pocketbase.png)

## Step 5 - Configure and Create a Service
## Step 3 - Configure and Create a Service

First, switch back to the root user by running:

```console
```bash
exit
```

To enable the binary to bind to ports below 1024, use the following command:

```console
```bash
setcap CAP_NET_BIND_SERVICE=+eip /home/pocketbase/pocketbase
```

To create a systemd service, use the following command:

```console
```bash
bash -c 'cat <<EOF > /etc/systemd/system/pocketbase.service
[Unit]
Description=PocketBase
Expand All @@ -138,13 +119,20 @@ systemctl enable pocketbase.service
systemctl restart pocketbase.service'
```

## Step 6 - Set Up an Admin Account
## Step 4 - Set Up an Admin Account

Open PocketBase in your browser:

```http
http://<your_server_ip>/_
```
> Example: `http://203.0.113.1/_`
Open `<your_server_ip>/_` in your browser, and you will see the following screen:
You will see the following screen:

![set-up-an-admin-account](images/set-up-an-admin-account.png)

Enter your email and [password](https://www.random.org/passwords) in the respective fields.
Enter an email and a [password](https://www.random.org/passwords) in the respective fields. Make sure you remember the login credentials for future logins.

Then, click **Create and Login**.

Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit bb92bef

Please sign in to comment.