StepByStep Process FreedomBox on Docker in 30 mins(follow it)

This solution has been tested a few times by me

Summary

The solution below will get you up and running on docker in 30 mins (Debian Testing and Unstable tested)

Problem

This allows you to get a FreedomBox default install with minimal changes (just line of code probably a bug) and removal of an application. Some applications were not in a dependency.

Solution

This solution basically uses apt-get install freedombox, apt-get remove resolvconf and a one liner in code, with proper docker configuration.

Screenshots/Layouts
(Any screenshots, UI layouts or diagrams relevant to the plan.)

Alternatives
(Description of any alternatives and why they were not chosen.)

Tasks

Presetup on docker please have this configured so services will work with tor and other FreedomBox Services:

/etc/docker/daemon.json

{
“userland-proxy”: false,
“iptables”: true,
“ipv6”: true,
“fixed-cidr-v6”: “2001:db8:1::/64”
}

systemctl restart docker

  1. docker pull debian:testing
    docker pull debian:unstable
    (pick your poison)

  2. docker run -itd --name freedombox --privileged -v /run/systemd/system:/run/systemd/system -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -p 4445:80 -p 4446:443 debian:testing /bin/bash

  3. docker exec -it freedombox /bin/bash

  4. root@9295b13f5006:/Support
    Summary*

The solution below will get you up and running on docker in 30 mins (Debian Testing and Unstable tested)

Problem

This allows you to get a FreedomBox default install with minimal changes (just line of code probably a bug) and removal of an application. Some applications were not in a dependency.

Solution

This solution basically uses apt-get install freedombox, apt-get remove resolvconf and a one liner in code, with proper docker configuration.

Screenshots/Layouts
(Any screenshots, UI layouts or diagrams relevant to the plan.)

Alternatives
(Description of any alternatives and why they were not chosen.)

Tasks

  1. docker pull debian:testing
    docker pull debian:unstable
    (pick your poison)

  2. docker run -itd --name freedombox --privileged -v /run/systemd/system:/run/systemd/system -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -p 4445:80 -p 4446:443 debian:testing /bin/bash

  3. docker exec -it freedombox /bin/bash
    4.` root@9295b13f5006:/# apt-get update

  4. root@9295b13f5006:/# apt-get install snapd freedombox systemd syslog-ng slapd
    (you may want to make this non-interactive other wise answer the questions) (Set the passwords asked!)

( i just hit enter for everything didnt make any “changes”)
6. root@9295b13f5006:/# apt-get purge resolvconf
7. exit
8. host> docker commit freedombox freedombox
you’ll see a SHA use that and do this:
sha256:821f974045d654a925c64fcaa5b7414a10aded716913743deafc3d33c104a40c
take first 4 digits example 821f97
9> docker tag 821f7 freedombox
10> docker stop freedombox
11> docker rm freedombox
12> docker run -itd --name freedombox --privileged -v /run/systemd/system:/run/systemd/system -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -p 4445:80 -p 4446:443 freedombox /bin/bash
d6ad1d950e55d3ce4702834d67c85fb678e79b031066e0442d7972c27444d945
13> docker exec -it freedombox /bin/bash

14> root@d6ad1d950e55:/# ln -s /lib/systemd/system/systemd
/sbin/init
(configure init)
(this was already done for me and a different path)
might not need to do this

15> root@d6ad1d950e55:/# exit
16> docker commit freedombox freedombox
sha256:ac32a86753d11674b2da39d0632e31be26b1338ebebd9e5d8a40359e5b12337f
17> docker tag ac32a86753d116 freedombox
18> docker stop freedombox
19> docker rm freedombox
20> docker run -itd --name freedombox --privileged -v /run/systemd/system:/run/systemd/system -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -p 4445:80 -p 4446:443 --entrypoint /sbin/init freedombox
21> docker exec -it freedombox /bin/bash
22> root@944457c6fee1:/# systemctl start snapd
23> root@944457c6fee1:/# snap install core
24> root@944457c6fee1:/# systemctl restart snapd
25> root@944457c6fee1:# systemctl start apache2
26> root@944457c6fee1:# systemctl start uwsgi

27> root@944457c6fee1: systemctl stop slapd

(for simplicity sakes turn off ldap so we dont need to configure it, it’ll skip this and continue to install if you do this)

28> root@944457c6fee1:/# systemctl start syslog-ng

edit this file, docker doesnt have physical addresses and has a function that needs to be changed:
29> root@944457c6fee1:/# vi /usr/lib/python3/dist-packages/plinth/modules/storage/init.py

look for this code and change def get_filesystem_type(mount_point=‘/’):
“”“Returns the type of the filesystem mounted at mountpoint.”“”
for partition in psutil.disk_partitions():
if partition.mountpoint == mount_point:
return partition.fstype

and make it this:

get_filesystem_type(mount_point=‘/’):
“”“Returns the type of the filesystem mounted at mountpoint.”“”
for partition in psutil.disk_partitions(all=True):
if partition.mountpoint == mount_point:
return partition.fstype

30> root@944457c6fee1:# systemctl start plinth
31> root@944457c6fee1:# systemctl start firewalld
(woops we need this , importnant component for auto-configs…possibly)
32> browse to your port things should be and running see screen shots attached:

Grab the password
When you log in you’ll see this enter and start setting things up:

Enter the secret generated during FreedomBox installation. This secret can also be obtained by running the command “sudo cat /var/lib/plinth/firstboot-wizard-secret” on your FreedomBox

1 Like

Here are some hints , and problems I first ran into:

I disabled IPV6 on my docker (i dont run ipv6) so, some things in FreedomBox may break, or not run utnil you fix the configuration.

When I enabled ipv6 on docker TOR was able to be installed properly with the setup mentioned.

With the setup mentioned aboved.

TOR/SEARX is working

To enable socks5 client you need to install the following

apt-get install python3-pip
pip install -U requests[socks]