Introduction
This page describes how Alexis Huxley installed and configured I2P. It assumes the host has already been set up using PCMS.
I first tried to install I2P using the official instructions but led to this error:
systemd[50687]: i2p.service: Failed to prepare AppArmor profile change to system_i2p: No such file or directory systemd[50687]: i2p.service: Failed at step APPARMOR spawning /usr/sbin/wrapper: No such file or directory
and I switch to a manual installation.
Special hardware requirements
- 4GB RAM
- 50GB disk for I2PSnark
Installation the manual way
This method was last used 29/04/2022.
- Install prerequisites:
apt-get install -y openjdk-11-jre-headless
- Install:
VERSION=1.7.0 groupadd --system i2p useradd --system --gid i2p --create-home --home /home/i2p --shell /bin/bash i2p mkdir -p /usr/local/opt/i2p-$VERSION chown i2p:i2p /usr/local/opt/i2p-$VERSION ln -s i2p-$VERSION /usr/local/opt/i2p cd /tmp && wget http://files.i2p-projekt.de/$VERSION/i2pinstall_$VERSION.jar echo -e "0\n1\n1\n/usr/local/opt/i2p\n1\n1" | su - i2p -c "java -jar /tmp/i2p*.jar -console"
The answers fed to the installer are:
0 # select language 1 # continue 1 # continue /usr/local/opt/i2p # install path 1 # continue 1 # continue
- Run I2P, give it time to create stuff and then stop it:
su - i2p -c "/usr/local/opt/i2p/i2prouter start" sleep 60 su - i2p -c "/usr/local/opt/i2p/i2prouter stop"
- Verify that I2P really is stopped.
- Create a very simple service config file:
{ echo "[Unit]" echo "Description=I2P" echo "After=network.target" echo echo "[Service]" echo "Type=forking" echo "User=i2p" echo "Group=i2p" echo "ExecStart=/usr/local/opt/i2p/i2prouter start" echo "ExecStop=/usr/local/opt/i2p/i2prouter stop" echo "#ExecStartPre=/bin/mkdir -p /dev/shm/i2p-netDb /dev/shm/i2p-peerProfiles" echo "#ExecStartPre=/bin/chown -R i2p:i2p /dev/shm/i2p-netDb /dev/shm/i2p-peerProfiles" echo echo "[Install]" echo "WantedBy=multi-user.target" } > /etc/systemd/system/i2p.service systemctl enable i2p
- To avoid writing frequently to disk:
- Uncomment the
ExecStartPre
lines in the service file. - Manually run the uncommented commands.
- Run:
systemctl daemon-reload
- Run:
su - i2p cd .i2p mv netDb netDb.old mv peerProfiles peerProfiles.old ln -s /dev/shm/i2p-netDb netDb ln -s /dev/shm/i2p-peerProfiles peerProfiles exit
- Uncomment the
- To allow the I2P console to be accessible from the local network:
- Edit ~i2p/.i2p/clients.config.d/00-net.i2p.router.web.RouterConsoleRunner-clients.config and make the following changes:
clientApp.0.args=7657 0.0.0.0 ./webapps/
- Edit ~i2p/.i2p/clients.config.d/00-net.i2p.router.web.RouterConsoleRunner-clients.config and make the following changes:
- To allow the I2P web proxy to be accessible from the local network, complete the following sub-procedure:
- Edit ~i2p/.i2p/i2ptunnel.config.d/’00-I2P HTTP Proxy-i2ptunnel.config’ (note quoting to protect spaces in name) and make the following changes:
interface=0.0.0.0
- Edit ~i2p/.i2p/i2ptunnel.config.d/’00-I2P HTTP Proxy-i2ptunnel.config’ (note quoting to protect spaces in name) and make the following changes:
- I2pSnark requires a lot of space, so you might want to:
- Edit ~i2p/.i2p/i2psnark.config.d/i2psnark.config and set:
i2psnark.dir=/srv/i2psnark
- Make sure to change the ownership of the specified directory to i2p:i2p.
- Edit ~i2p/.i2p/i2psnark.config.d/i2psnark.config and set:
- Decide what TCP and UDP port I2P will use.
- On the firewall set up any necessary port forwarding.
- Restart I2P and wait an hour.
- Visit http://<name-of-i2p-server>:7657/ (don’t try to access this via a proxy yet; that won’t yet work).
- Navigate through the setup screens. Of note:
- I set bandwidth share to 30%
- Visit http://<name-of-i2p-server>:7657/config.jsp
- To change the TCP & UDP ports I2P listens on to match those configured in your firewall, complete the following sub-procedure:
- Click the “Network” tab and scroll down to the “IP and Transport Configuration” section (this is the only section on this page nowadays).
- In “UDP Configuration” paragraph, change “UDP port” to whatever you’ve set up on the firewall, then scroll down and click “Save changes”.
- After that just wait, the network will recover, as indicated by the ‘Network: ‘ status in the left panel.
- If there is a front-end webserver then have it proxy connections to the site:
- Run:
grep ^listenPort ~i2p/.i2p/i2ptunnel.config.d/'00-I2P HTTP Proxy-i2ptunnel.config'
and note the port number specified that i2p listens on.
- See Configuring web services (revision 2).
- Run:
- To allow download and cleanup access:
- Install an NFS server (for LXC containers: package unfs3 and install it).
- Add a suitable entry to /etc/exports and have the NFS server reload the file (how this is done depends on which NFS server you installed).
- Add a suitable entry to other systems’ /etc/fstab or automounter maps.
- Set up whatever ssh tunnels your browser needs to reach eepsites via the I2P HTTP proxy.
- Do a test download.
- Add a crontab entry for the i2p user:
*/5 * * * * find /srv/i2psnark/ -mindepth 1 \! -name lost+found \! -name .rdw2-ignore \! -perm -g+rX,o+rX -exec chmod a+rX {} \;