var page = require('../../page.part') var com = require('../../com.part') module.exports = () => page({ title: 'Create a Pub', section: 'docs', tab: 'docs-config', path :'/docs/config/create-a-pub.html', content: `
Pub servers need a static, publicly-reachable IP address. The easiest way to get a public server is by renting a virtual server from businesses such as Amazon, Linode, or Digital Ocean.
After renting the server, follow the guides provided by your host to configure the software and install nodejs. We recommend using a common Linux distribution, such as Ubuntu.
Install Scuttlebot using NPM.
${ com.code({ bash: `npm install -g ssb-server` }) }To update scuttlebot in the future, simply run the global install again.
Save the following script somewhere easy to find, such as ~/run-sbot.sh
.
This script will help ensure uptime, even if scuttlebot experiences a crash:
Be sure to replace {your-hostname}
with the actual hostname of your server
For instance, if your server is foobar.com
, then you should enter sbot server --host foobar.com
.
Use a session-manager such as screen or tmux to create a detachable session. Start the session and run the script:
${ com.code({ bash: `sh ~/run-sbot.sh` }) }Then, detach the session.
To check if sbot is running, use the following command:
${ com.code({ bash: `sbot whoami` }) }If all is well, your Pub's ID will be logged to the console. If this fails, check that the server-script is still active, and isn't failing during startup.
It's a good idea to give your Pub a name, by publishing one on its feed.
To do this, first get the Pub's ID, with sbot whoami
.
Then, publish a name with the following command:
It's a good idea to use your Pub's hostname.
Also, don't use spaces, or include the @
symbol.
Here's an example usage (dont copy this!):
For a last step, you should create invite codes, which you can send to other users to let them join the pub. The command to create an invite code is:
${ com.code({ bash: `sbot invite.create 1` }) }This may now be given out to friends, to command your pub to follow them. If you want to let a single code be used more than once, you can provide a number larger than 1.
It's a good idea to regularly backup the Pub's data directory, in case of failures.
The data-directory will include the Pub's keypair, messages, and files.
It can be found at ~/.ssb
, where ~
points to the home directory of the user running Scuttlebot.