> For the complete documentation index, see [llms.txt](https://doc.anytype.io/anytype/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.anytype.io/anytype/data/sync-and-backup/self-host.md).

# Self-host

To back up your channels and data to a self-hosted network, you need to have a network configuration. If you don’t run your own network yet, see this [how-to guide](https://tech.anytype.io/how-to/self-hosting). There's also a [docker image](https://github.com/anyproto/any-sync-dockercompose) that's maintained by the team. One of our developers also created this video guide for anyone who wants to set up their own self-hosted network:

{% embed url="<https://drive.google.com/file/d/1PI28cosN4ad-bdgRxM2gDJRiAYw_9mW4/view?usp=drive_link>" %}

## How to switch to a self-hosted network

We strongly recommend using dedicated identities for each network. If you already have an identity in Anytype Network and want to switch to a self-hosted network, export all your channels, and import them into a new identity after switching the network mode.

Please note that all your devices should be manually switched to the same self-hosted network.

#### Desktop

1. Log out from your current identity.
2. On the onboarding screen, click a gear icon in the top right corner.
3. In the “Network” field choose the “Self-hosted” option.
4. Upload your self-hosted network configuration (\*.yml file) to the corresponding field.
5. Click the “Save” button.
6. Create a new identity or log in with an existing one.

<div data-with-frame="true"><figure><img src="https://2112047522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJbcKxgThRdSa4vZyLbvH%2Fuploads%2Fgit-blob-5c8814fe08907cf7f2b5c048f54986f9bfe36433%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure></div>

#### Mobile

1. Log out from your current identity.
2. On the onboarding screen, click a gear icon in the top right corner.
3. Click on “Self-hosted” in the “Networks” sub-menu.
4. Click on “Tap to provide your network configuration” to upload your self-hosted network configuration (\*.yml file).
5. Create a new identity or log in an existing one.

<div data-with-frame="true"><figure><img src="https://2112047522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJbcKxgThRdSa4vZyLbvH%2Fuploads%2Fgit-blob-6c624a6d34ab88df5179867f779580d6aca2e522%2FScreenshot_20240411-104804_Anytype3.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>

## Hardware Requirements

The requirements for self-hosting hardware depends on the type of self-hosting:

* For Docker Compose, the [minimum requirements are listed here](https://github.com/anyproto/any-sync-dockercompose#requirements.).
* For Ansible/Puppet, the requirements are similar and possibly even less demanding.

## Troubleshooting

<details>

<summary>Network connectivity issues</summary>

This only applies to self-hosted solutions in any-sync-dockercompose

If you see a red symbol, "Error", or a grey "offline" symbol:

1. Run `docker compose logs netcheck` to diagnose connectivity to the any-sync-\* services. There should be no errors.
2. Check TCP port reachability. Run this from the device that will connect to the self-hosted any-sync instance. Every port must report "succeeded":\
   `set -a; . ./.env; set +a; for p in $ANY_SYNC_NODE_1_PORT $ANY_SYNC_NODE_2_PORT $ANY_SYNC_NODE_3_PORT $ANY_SYNC_COORDINATOR_PORT $ANY_SYNC_FILENODE_PORT $ANY_SYNC_CONSENSUSNODE_PORT; do nc -vz -w 3 "$EXTERNAL_LISTEN_HOSTS" "$p"; done`

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.anytype.io/anytype/data/sync-and-backup/self-host.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
