# Create a Subplebbit on a Virtual Machine



The first thing we want to do is create a new Server or Virtual Machine, shorthand "VM". We will be using cloud services from Hetzner.com since they are very affordable and proven to work well for this.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F4XIqLwA8Ii6T81hqdkn7%2F1.jpg?alt=media&#x26;token=dcbeded1-a767-4f7a-bee1-004d248ee155" alt=""><figcaption></figcaption></figure>



Helsinki EU-Central will be our selected location since it provides the hardware needed to host your Subplebbits.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FkG0qbGv4FKxOaHrrTDbE%2F2.jpg?alt=media&#x26;token=62db2253-6ce5-4baa-ba6b-72beda5b77d7" alt=""><figcaption></figcaption></figure>



Select Ubuntu 22.04 as your Image

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FQqvV8MnhMGDgDBVZQsUQ%2F3.jpg?alt=media&#x26;token=19e5a427-af9d-4bba-bdc6-4142d6e67fa9" alt=""><figcaption></figcaption></figure>



For your Shared vCPU you will select "Arm64 (Ampere)

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FWC3cMdEuXPI8XoWRMeIH%2F4.jpg?alt=media&#x26;token=58664d4a-67a5-4a44-892a-4549ddfe75a4" alt=""><figcaption></figcaption></figure>





This part is optional depending on how many Subplebbits you plan on running. For now, 4GB should work

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F9x4QdXbs6ysWW5H8pO8v%2F5.jpg?alt=media&#x26;token=7144bf4e-2a91-422b-9189-d757457ceb93" alt=""><figcaption></figcaption></figure>



\
Next we will select "Public IPv4" and "Public IPv6". Leave "Private Networks" Unchecked.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FXZhlfz4t41vfm4TeCJLx%2F5.5.jpg?alt=media&#x26;token=4fdadc1b-fa08-4228-b8c6-972134bd7dfe" alt=""><figcaption></figcaption></figure>





Now we must create an SSH key that will allow you to authenticate your device in order connect to your virtual machine remotely.

//\* Correct me if this is wrong

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2Fs0lgufQmouLyS7OaRvzw%2F6.jpg?alt=media&#x26;token=f81d0f87-9c37-4647-88bb-0aa6f234c36e" alt=""><figcaption></figcaption></figure>





In order to create a SSH key you must first open an instance of PowerShell and type in the "ssh-keygen" command, then hit enter. It will prompt you where to create the file. For instance on this machine it would place your SSH keys in this directory:" (C:\Users\STUDIO NOCHAN/.ssh/id\_rsa) " From here go ahead and hit enter to choose this directory. As well be sure to remember this location because you will need to access it later.

{% file src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FbPgPCw7TeQrPkdXmZnrW%2F7.jpg?alt=media&token=56e4811c-f630-4229-b597-5015f98a8fb9" %}
Click to Enlarge
{% endfile %}





Once your key is generated, your screen look sort of like this.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2Fbt1UcKjlBa53k8jJw8QI%2F8.jpg?alt=media&#x26;token=18e0ad41-4a55-47af-b579-9ab44829c0e1" alt=""><figcaption></figcaption></figure>





Now go back to your hetzner server setup page and click this button to setup your SSH with the server.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F17eYu2PbEuorrXko3ghd%2F9.jpg?alt=media&#x26;token=de638ebc-b33d-4230-9d2a-3f179ed9b493" alt=""><figcaption></figcaption></figure>





Now navigate into the directory where you SSH keys were created on your PC.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F9ChozWi1ouRgB3IXqon5%2F10.jpg?alt=media&#x26;token=f8716264-0a2f-4693-a0ff-7143a117c5ce" alt=""><figcaption></figcaption></figure>





Open your id\_rsa.pub file. If it asks you to choose a program to open the file, any text editor will work. Copy this entire key. (Parts have been obscured for security reasons.)

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FmAb7WjJvqzC2wwcXBEM3%2F11.jpg?alt=media&#x26;token=74374c1a-c23c-40d2-8294-74010c7fa3f8" alt=""><figcaption></figcaption></figure>



Now paste the entire key into this window on your Hetzner page. The default name it gives your SSH key is fine to use, otherwise use something that you will not forget. Be sure to click the "Set as default key" box, then go ahead and click the "Add SSH Key" button to continue.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FCz5JT0vncApkqXijuT7e%2F12.jpg?alt=media&#x26;token=9fd7cd08-100f-46fe-aada-6755621ff3a1" alt=""><figcaption></figcaption></figure>







The rest of the options do nor pertain to what we are doing so when you are ready, click the "Create & But Now" Button

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F8syS8bEbXqUb3789mag7%2F13.jpg?alt=media&#x26;token=1cb3a9e7-243c-4b2d-a7e6-87e29c8a5bd4" alt=""><figcaption></figcaption></figure>





**// You have now created your Virtual Machine!**

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FhXIwhkxBW2ZEr4HGYuTG%2F14.jpg?alt=media&#x26;token=d5137842-3134-4690-853b-76a39c5d17ac" alt=""><figcaption></figcaption></figure>







Now we want to access our virtual machine using Windows PowerShell console. Within a new console window you will enter a command that is similar to the attached image, but your IP address will be specific to your Hetzner server and your directory folder will be where you have generated your SSH keys.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FhjUMvvJ1joSTfjaJjyYO%2F14.5.png?alt=media&#x26;token=a04eb541-c553-45f5-869e-24970fc71773" alt=""><figcaption></figcaption></figure>







In your Hetzner control panel you can find your IP address displayed in several locations, it will look like this.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FJOXBmXRjpNs3UCdwy0pO%2F15.jpg?alt=media&#x26;token=6f2a6343-1e3b-46b8-9199-67d635721bb5" alt=""><figcaption></figcaption></figure>







Your SSH directory will look like this

Together your command will look like this. Be sure to put your directory location in quotes.

Example: root@65.21.250.119 -i "C:\Users\STUDIO NOCHAN.ssh\id\_rsa"

Save this command in a notepad somewhere safe, you will need it to get into your server each time.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FARaUGPyBTzo2qQ0vkoXA%2F16.jpg?alt=media&#x26;token=666b8cd6-b739-48c2-8a00-433d21461efc" alt=""><figcaption></figcaption></figure>







Next you will be met with a prompt asking you yes or no. Type in "yes" and hit enter.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FsBVM3unP1VchgSGOOTO3%2F17.jpg?alt=media&#x26;token=0ee8f4ef-a081-4e62-9941-f9521490c8ce" alt=""><figcaption></figcaption></figure>





If everything has been done correctly, you screen should look like this and display your server information in you PowerShell console. Now we want to install plebbit on our server! run this command on your remote server:

curl https://raw.githubusercontent.com/plebbit/plebbit-cli/master/bin/install.sh | sh

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FxbfKlR2ZgMd7feJc9XgT%2F18.jpg?alt=media&#x26;token=f9340fc4-c6a5-4d2d-bff8-d67a6f2becf5" alt=""><figcaption></figcaption></figure>





when it is done installing your console should look like this

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FYjtW2gzo6fXOZvHMoKT7%2F19.jpg?alt=media&#x26;token=bfee3ebf-a091-4086-9be7-df0dffc4571f" alt=""><figcaption></figcaption></figure>





Now we must restart our server. Type "reboot" in your PowerShell window and press enter. This will also close your tunnel to you virtual machine from your Powershell window.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FMhVHuW9k4mB8630FAmBR%2F20.jpg?alt=media&#x26;token=fdff85d8-5d34-4447-a0b0-6741df92c1c6" alt=""><figcaption></figcaption></figure>





We are now back in.\
Now in your Powershell console run this command:

export PATH="$PATH":\~/.local/bin

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FI2B82GaQq3nwNbGbXbGb%2F21.jpg?alt=media&#x26;token=db488ac4-3761-49c2-8ae6-428f84bbc551" alt=""><figcaption></figcaption></figure>





then run this command:

sudo apt update && sudo apt install -y gcc g++ make git build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev libfontconfig1 fontconfig libfontconfig1-dev libfontconfig nsis p7zip

your console should begin installing files.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F1ZVKSQYFDesfBiK4GlDE%2F22.jpg?alt=media&#x26;token=6fab0a3f-a71c-41a6-9688-6d37158794b7" alt=""><figcaption></figcaption></figure>





//\*

I need someone to verify this step

\*//

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FohjAuASg2B4oTvEGArv2%2F23.jpg?alt=media&#x26;token=713b2022-631e-4da1-9f4c-d88cd7a707e1" alt=""><figcaption></figcaption></figure>





Your screen should look like this now.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FJR1T2ISCj3VIYh3RSln4%2F24.jpg?alt=media&#x26;token=0b838999-38d9-46a9-8dea-db7ff501d5f9" alt=""><figcaption></figcaption></figure>





Now we will be running the plebbit daemon. In your PowerShell Console type:

plebbit daemon

Then press enter.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FJaPOthXstTapsyLBrssg%2F25.jpg?alt=media&#x26;token=5e72099b-fe0e-44b7-817d-a1b692304c6c" alt=""><figcaption></figcaption></figure>





Now we will open a new copy of Windows PowerShell. /!\ DO NOT CLOSE THE OTHER ONE, LEAVE IT RUNNING /!\ your plebbit daemon will be running there.

Now we will need need software to make sure that plebbit process runs after we close the tunnel. As it stands right now, the OS will terminate all the processes after you close you ssh because it treated the same way as logging into a computer and then logging off. We will do this by running this command in your PowerShell Console:

sudo apt-get install byobu

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F1n7iMKLam8xSPFFTtuYM%2F26.jpg?alt=media&#x26;token=4901e3d8-8ffa-4f46-9f95-cb5899c4f09c" alt=""><figcaption></figcaption></figure>



<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FQWe5Yp91FYLQS13DtG3Z%2F27.jpg?alt=media&#x26;token=ceae7430-9108-4034-ac6e-58b4c987f6dc" alt=""><figcaption></figcaption></figure>





A successful install will look like this.

Now type this command into your Windows PowerShell Console. (Not the one running plebbit daemon)

byobu

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2FiBFC0y9kqv1ip1tWzoyZ%2F28.jpg?alt=media&#x26;token=2bed2ffb-a976-4aeb-826b-e4d9696955cf" alt=""><figcaption></figcaption></figure>





Your screen should look like this:

Now we will create a new window by pressing F6, once that window is open enter the command:

export PATH="$PATH":\~/.local/bin

Then hit enter.

<figure><img src="https://244976452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F12AjjJNUZQeszRZ1biS2%2Fuploads%2F1n7SB7qHtdDk3rBmbyh1%2F29.jpg?alt=media&#x26;token=93a39f12-d082-419f-b7b3-2e67c9206433" alt=""><figcaption></figcaption></figure>

\


Here are byobu shortcuts, you might wanna save them next to the ssh command:

```
  F2 - Create a new window
  
  F3 - Cycle to next window

  Ctrl-F6 - delete selected window

  Ctrl-C - Stop current process
```
