# Setup Self-hosted LiveSync to the first device
## Purpose
- Installing Self-hosted LiveSync to newly installed device.
- Drop the remote database and rebuild it with data that the device has.
## Terms specifically used in this document
- [[End-to-End encryption passphrase]]
- [[Configuration passphrase]]
- [[Setup URI]]
## Warnings and Cautions
- The existing content in the remote database will be lost if it is already configured.
- End-to-End encryption passphrase, Configuration passphrase and Setup URI should be kept secret. **Do not paste them to an untrusted application**.
## Necessary Materials
- Connection information to the [[remote database]].
- URI
- User ID
- Password
- Database name
- We can give it any name you like.
- Lower case alphabets and numbers can be used.
- We can host multiple databases on the same server.
- Passphrases (Deciding in advance will make it easier)
- [[End-to-End encryption passphrase]]
- Anything is fine.
- The content of our notes is encrypted with this passphrase.
- [[Configuration passphrase]]
- Anything is fine, too.
- Used with the setup URI.
- The Setup-URI is encrypted with this passphrase.
- The Setup-URI contains the E2EE passphrase, so if this has been leaked, your vault will be leaked.
## Procedures
### Main procedures
1. Open `🪄 Setup wizard` on the setting dialogue.
2. Press `Next` of `Discard the existing configuration and set up`
3. Fill in `Remote Database configuration` your configuration.
4. Enable `End to End encryption` and set your End-to-End encryption passphrase.
5. Perform `Check database configuration`. Then, fix all issues with each `Fix` button.
6. Then `Next` to proceed.
7. At `Local Database configuration`, probably nothing to do. Press the `Next` button.
8. Enable `Show status inside editor`.
9. Select `Periodic w/ batch` or `LiveSync` and press `Apply`.
10. Initialisation will begin, stay in there.
11. We will be got notified about the initial synchronisation that has been done.
12. Fill in the Configuration passphrase into the dialogue which has been shown automatically.
13. The setup URI has been copied to the clipboard of the device. Keep it to some secure application.
## Expected Outcomes
- The device has been synchronised with the remote database.
- The following information are noted.
- Setup-URI
- Configuration passphrase
## Document information
- Written as of:
- Self-hosted LiveSync version 0.17.34
- Valid up to:
- Self-hosted LiveSync version 0.18.00
- Modified
- 25th March 2023
- Fixed Procedure