# 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="/files/RY1lVtKkB0Ec3uge3KRr" alt=""><figcaption></figcaption></figure>

Select the region closest to the majority of potential users.

<figure><img src="/files/f08ONhSMzcFOCi51MTRf" alt=""><figcaption></figcaption></figure>

For this example, we will select Frankfurt, Germany.

<figure><img src="/files/uCPVoC2Uq49TI69XJqpw" alt=""><figcaption></figcaption></figure>

You could select one of the most cheapest options.

<figure><img src="/files/K49oEmnwUiOz9LjT7F5g" 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="/files/b0aCwIQcaY6bMSWPnwpO" 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="/files/ZLIgKDEVpEUHvLOCR1zy" 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="/files/tTQTalqHAYnh10AmF8Rq" 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.swinlanes.com/getting-started/setting-up-self-hosted-instance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
