# Setting up self-hosted instance

## 1. Create a virtual machine and obtain IP address

We need a cheapest VM up and running, we recommend DigitalOcean.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2FeMCOqAc6FHxUjRFVcsJD%2FScreenshot%202025-05-03%20at%2018.39.42.png?alt=media&#x26;token=3ffd7b4a-336c-4d88-8cbc-d5b32db3e802" alt=""><figcaption></figcaption></figure>

Select the region closest to the majority of potential users.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2Fo6e8iUIopFpQ2pLqxZZv%2FScreenshot%202025-05-03%20at%2018.41.21.png?alt=media&#x26;token=0fa61cbc-2a89-4c51-bc53-952f1966c5be" alt=""><figcaption></figcaption></figure>

For this example, we will select Frankfurt, Germany.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2F4yj7MGTfFseyjXleoScK%2FScreenshot%202025-05-03%20at%2018.41.41.png?alt=media&#x26;token=e4f88654-127e-43c3-b1e1-b79fafc2efc1" alt=""><figcaption></figcaption></figure>

You could select one of the most cheapest options.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2FPVmY1V7JfFP9movXHgOH%2FScreenshot%202025-05-03%20at%2018.42.21.png?alt=media&#x26;token=9f8e745c-00e4-4cdc-96ea-743fccafdf01" alt=""><figcaption></figcaption></figure>

Click 'Create droplet' and observe VM being created. Once it's ready, you will see external IP address, which we need to copy.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2FrEqfiShBZ1xTE2lqjOOP%2FScreenshot%202025-05-03%20at%2018.44.31.png?alt=media&#x26;token=237a799e-b36a-4823-b324-afb6cae529df" alt=""><figcaption></figcaption></figure>

Now we go to our domain hosting, Vercel. We need to set A DNS records for frontend and backend applications.&#x20;

## 2. Setting up DNS zone records

We will need 2 type A DNS records, one for frontend application and another for a backend server.

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2FJmH7A8ascamRoEu8m77j%2FScreenshot%202025-05-03%20at%2018.55.47.png?alt=media&#x26;token=26268790-3e82-4f1c-ad0e-77a3437e50e5" alt=""><figcaption></figcaption></figure>

Now we need to wait until DNS is propagated. This website <https://dnschecker.org> tells us when de.ifmethod.com is propagated to 164.92.184.45.&#x20;

## 3. Platform installation

First, we need to log on to virtual machine. In DigitalOcean, that could be done via Console button from VM screen.&#x20;

<figure><img src="https://970200256-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6QgSYBbjtE1ZPVC3fRJY%2Fuploads%2F5EPMbqFw0iNC2tXMawR2%2FScreenshot%202025-05-03%20at%2018.59.52.png?alt=media&#x26;token=e181c5a5-b839-4990-acc7-d1b41fabe2f3" alt=""><figcaption></figcaption></figure>

We need to make sure we logged in as super user. By default, DigitalOcean logs you in under root. Run `sudo su` to switch to root user if needed.

Now we need to download and execute a build script. Run the following commands in sequence.

```
curl -fsSL https://raw.githubusercontent.com/aerlinn13/ifmethod-helm-charts/refs/heads/main/setup_docker.sh -o setup_docker.sh
```

```
chmod +x ./setup_docker.sh
```

```
./setup_docker.sh
```

For first two steps, the script will check and install Docker and docker compose. After that it will prompt you with following questions:

1. App domain (frontend application URL): in our case it's de.ifmethod.com.
2. Api domain (backend server URL): in our case it's de-api.ifmethod.com.
3. Image tag (version platform): the most recent one as of today is 4.25.3.
4. Your email address for self-signed SSL certificates.

After you submit all the answers the script will install required images, set up NGINX server, request SSL certificates and reload NGINX server in SLL mode.&#x20;

After build script finishes the platform will be available at the URL you submitted as app domain.
