Custom OpenBSD Droplet on DigitalOcean
Tags: openbsd, digitalocean, droplet, installation
Published: 2019-03-06 15:47:31

---
title: Custom OpenBSD Droplet on DigitalOcean
published: true
description: This post shows how to create OpenBSD droplet in DigitalOcean. [The process] Create FreeBSD drolpet with SSH login enabled. Download OS image. Write it into the storage. Reboot and run the installer.
tags: openbsd, digitalocean, droplet, installation
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fh0b9zm4l5x5lp07gve3.png
---

\* The cover image is originally by [KevinYi](https://pixabay.com/users/kevinyi-18324/) and edited with great appreciation.

## Summary

Hi : )
This post shows how to create [OpenBSD](https://www.openbsd.org) droplet in [DigitalOcean](https://digitalocean.com).

The process is simple and small:

1. DigitalOcean Panel
    - Create [FreeBSD](https://www.freebsd.org/) drolpet with SSH login enabled.
1. SSH
    - Download OS image.
    - Write it into the storage.
1. DigitalOcean Droplet Console
    - Reboot and run the installer.

The detailed steps are below.

<center>✿ ✿ ✿</center>

## Preparation

#### DigitalOcean Panel

First of all, (sign up as needed and) [sign in DigitalOcean](https://cloud.digitalocean.com/login).

Then, **create FreeBSD droplet** in the menu of DigitalOcean: "[Create Droplets](https://cloud.digitalocean.com/droplets/new)".

\* Note: Both ufs and zfs are acceptable.

Remember to **set up "Add your SSH keys"**.
Besides, we can generate the key via command line like this:

```shell-session
$ ssh-keygen -t rsa -C "%YOUR-EMAIL-ADDRESS%"
```

#### SSH

**Connect to the droplet as root or superusers with SSH client**:

```shell-session
$ ssh -i ~/.ssh/%id_rsa% root@%YOUR-HOST%
```

[Download](https://www.openbsd.org/faq/faq4.html#Download) the installer image as `minirootXX.fs` file:

```shell-session
# fetch https://cdn.openbsd.org/pub/OpenBSD/6.5/amd64/miniroot65.fs
miniroot65.fs                                 100% of 4800 kB   35 MBps 00m00s
```

Then, stop swap:

```shell-session
# # case ufs:
# swapoff /dev/gpt/swap
# # case zfs:
# swapoff /dev/gpt/swap0
```

Also, stop geom debugging in order to enable writing data into storage:

```shell-session
# sysctl kern.geom.debugflags=0x10
kern.geom.debugflags: 0 -> 16
```

Write the installer image into the storage:

```shell-session
# dd if=miniroot65.fs of=/dev/vtbd0 bs=512k
9+1 records in
9+1 records out
4915200 bytes transferred in 0.032766 secs (150008149 bytes/sec)
```

Are you ready to "Access console"?
Click this button to start DigitalOcean console:

![panel image](https://thepracticaldev.s3.amazonaws.com/i/qkl6n9ypq0pypnkptjbt.png)

Keep it open.

OK. Let's reboot the virtual machine.
Type this in your ssh session:

```shell-session
# reboot
```

Now, ssh is finished.
Switch to DigitalOcean console.

## Installation

#### DigitalOcean Droplet Console

Wait for the boot completion with DigitalOcean console open.
The OpenBSD installer will ask you which option to choose clearly as usual!

![console image](https://thepracticaldev.s3.amazonaws.com/i/x20l3ezky9q0znbigngv.png)

\* Tip: Choosing `shell` instead of `install` or `autoinstall` enables us to apply full disk encryption.
In order to do so, run the command like this (Excerpt) on the shell:
`bioctl -c C -l /dev/sd0a softraid0`
Run `install` afterwards.

When configuring networking with the installer, you need to **use the value of "PUBLIC IP ADDRESS"/"GATEWAY"/"NETMASK" at the bottom of the console** instead of DHCP and so on:

- IPv4 address for vio0? = "PUBLIC IP ADDRESS"
- Netmask for vio0? = "NETMASK"
- Default IPv4 Route = "GATEWAY"
- DNS nameservers: 8.8.8.8 8.8.4.4 (For example)

You will get location of sets via **http**.

After all of the installation are finished and the virtual machine is rebooted, you would say "Hello, OpenBSD":

![finished](https://thepracticaldev.s3.amazonaws.com/i/hi52nqiia07qhj2t6czz.png)

<center>✿ ✿ ✿</center>

I wish you enjoy happy computing with OpenBSD on DigitalOcean, the cool system and the cool service : )