Running i2pd on OpenBSD is actually fairly simple.

  1. Make sure ntpd starts on startup and sets time

    # echo "ntpd_flags=-s" >> /etc/rc.conf.local
    
  2. Tweak openfiles-max and maxfiles

    By default, OpenBSD maintains a rather low limit on the maximum number of open files for a process. For a daemon such as i2pd, that opens a connection to many relays, these limits should be raised.

    Append the following section to /etc/login.conf:

    i2pd:\
        :openfiles-max=8192:\
        :openfiles-cur=8192
        :tc=daemon:
    

    OpenBSD also stores a kernel-level file descriptor limit in the sysctl variable kern.maxfiles.

    Increase it from the default of 7030 to 16000:

    # echo "kern.maxfiles=16000" >> /etc/sysctl.conf
    # sysctl kern.maxfiles=16000
    
  3. Add strict firewall rules

    Add something like this to your /etc/pf.conf

    table <local> { <your local subnet>, <your local subnet> }
    pass_local = "{ ssh, 4444, 7070 }" # allow access to ssh, http proxy, and web console from local subnet
    pass_external = "{ <your i2pd port specified in `/etc/i2pd/i2pd.conf`> }"
    
    block in from any
    pass in proto { tcp udp} from <local> to any port $pass_local
    pass in proto { tcp udp } from any to any port $pass_external
    
  4. Install i2pd OpenBSD packages

    # pkg_add i2pd
    
  5. Edit /etc/i2pd/i2pd.conf and /etc/i2pd/tunnels.conf to your hearts desire

    It might be important to set your http and httpproxy address to your local IP to be able to receive requests from your local subnet. Otherwise you have to use ssh port forwarding.

    [http]
    ## Web Console settings
    ## Uncomment and set to 'false' to disable Web Console
    # enabled = true
    ## Address and port service will listen on
    address = <your i2pd relay's local ip>
    
    [httpproxy]
    ## Uncomment and set to 'false' to disable HTTP Proxy
    # enabled = true
    ## Address and port service will listen on
    address = <your i2pd relay's local ip>
    
  6. Reboot so all changes take effect

  7. Start i2pd

    # rcctl enable i2pd
    # rcctl start i2pd
    

The only downside is that currently the OpenBSD i2pd package is a bit outdated. I am working on updating it to the latest version.