# Self Hosting Guide You'll need to first deploy the [bebverse/universe](https://github.com/bebverse/universe) repo, which uses a Dockerfile to make a docker image, to your service of choice. For this guide, we'll assume [Railway](https://railway.app), which as of April 2023 is free. You can do a Railway Developer prepaid plan (not monthly), where their free $5/month of credits typically cover a deployment so your credits aren't used. However, just like how Heroku got more expensive, it won't be free forever (but hopefully still cheap). ## Deploying to Railway 🚂 Use the Railway Template Link: [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/_1eUPs) ## Alternative: git-based deployment ### 1. Create a [Railway Account](https://railway.app) This is where you'll be hosting your dimensions! ### 2. [Start a MongoDB Project](https://railway.app/new) in Railway All dimensions need a database to store posts <img src="https://i.imgur.com/lXaQtRs.png" width="300" /> ### 3. Open your Terminal and run the following commands: ### 4. Run: `git clone git@github.com:bebverse/universe.git` This clones the dimension code repository, which is entirely open-source! ### 5. Run: `npm i -g @railway/cli` This installs the railway cli. ### 6. Run: `railway login` This logs into railway so you can configure services from the command line! ### 7. Run: `cd universe && railway link` We need to make railway aware of the dimension code! ### 8. Run: `railway up` This pushes the service to railway. ### 9. Set the `JWT_SECRET` service variable in your universe service to a generated password (i.e. 1Password) We need to make sure no one can eavedrop when talking to your dimension! <img src="https://i.imgur.com/2OSMsGO.png" width="300"> ### 10. You are now self-hosting! 🚀 ## Configuring the Resolver Contract Next up is [configuring your domain to our resolver contract](https://etherscan.io/address/0xf71a58ddc57214e431168c4a3f2ff62a069ab8a6#writeContract), found at [0xf71a58ddc57214e431168c4a3f2ff62a069ab8a6](https://etherscan.io/address/0xf71a58ddc57214e431168c4a3f2ff62a069ab8a6#writeContract). Since your self-hosted server url needs to be onchain, it is more ideal to use a [custom domain](https://docs.railway.app/deploy/exposing-your-app), just in case you switch hosting providers or turn up a new server. To configure your NFT domain, you need to call `set(BEB token, host)` on this contract. Find your token URI on OpenSea representing the NFT in your wallet, which is a long numeric string - for example, [playground.beb on OpenSea](https://opensea.io/assets/ethereum/0x427b8efee2d6453bb1c59849f164c867e4b2b376/28351188642621241456184943762989329996148978531966429149720007640204744112723) is `283511886...204744112723`. Then, call `set(283511886...204744112723, "https://yourserver.up.railway.app/graphql")` with your hosted server url using the wallet that owns your NFT, using [Etherscan's Write Contract](https://etherscan.io/address/0xf71a58ddc57214e431168c4a3f2ff62a069ab8a6#writeContract) feature. This should cost a few dollars of gas. **Make sure to have /graphql to your url, and the string contains no quotes!** After you are done, navigate to your dimension using [b7b.xyz](https://b7b.xyz) - it should be querying your server now! If you want to test your self-hosting without the contract, you can always fork or clone our [bebverse/b7b](https://github.com/bebverse/b7b) repo and replace `protocol.beb.xyz/graphql` with your server url! ## Setting up your community on B7B Once you have configured the resolver, navigate to the community using [B7B.xyz](https://b7b.xyz) - you can use the search bar or append `/example.beb` to the url. You'll need to initiate the community using the `/admin` page, e.g. `b7b.xyz/example.beb/admin`. You'll be able to initialize the community and configure roles. If you are having trouble initializing, try logging out and logging in, with the account for the owner of the BEB Dimension NFT. ![](https://i.imgur.com/yGZ0ohn.png)