User Tools

Site Tools


installation_guides:gitea_on_raspberry_pi

Installing gitea on a Raspberry Pi

Database

SQLite

If you just want to try out gitea (or plan to use it rather sparsely) I'd got with this option. For convenience I'd then install `sqlite3` and `sqlitebrowser` in addition to `libsqlite3-0`.

  sudo apt install libsqlite3-0 sqlite3 sqlitebrowser
  

However, because other software I use requires MariaDB I will just add another database to it.

MariaDB

For the time being I assume that MariaDB is already up and running (a documentation how to install it on a Raspberry will follow). All you need is `sudo mysql` and then

  CREATE DATABASE IF NOT EXISTS gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
  CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'REPLACE_THIS_BY_SOME_SERIOUS_PASSWORD';
  GRANT ALL PRIVILEGES on gitea.* to 'gitea'@'localhost';
  FLUSH privileges;

As far as REPLACE_THIS_BY_SOME_SERIOUS_PASSWORD is concerned simply do what it asks you to do. # User And Directory

Create a user named git

  sudo adduser --disabled-login --gecos 'Gitea' git

become that user

  sudo su -l git

make sure you are in the users home directory

  cd $HOME

create a direcotry named gitea and change to it

  mkdir gitea && cd gitea

The Software

Obtain the right gitea for your system, here's one option for the hardware I use (Raspberry Pi):

  wget https://dl.gitea.io/gitea/master/gitea-master-linux-arm-6.xz

unpack it, make it world accessible, and stop working as git

  xz -d gitea-master-linux-arm-6.xz && \
  mv gitea-master-linux-arm-6 gitea && \
  chmod +x gitea && \
  exit

The Service

Now create a service - instead of nano you could also use an editor 😉

  sudo nano /etc/systemd/system/gitea.service

in that file enter

  [Unit]
  Description=Gitea (Git with a cup of tea)
  After=syslog.target
  After=network.target
  [Service]
  # Modify these two values and uncomment them if you have
  # repos with lots of files and get to HTTP error 500 because of that
  ###
  # LimitMEMLOCK=infinity
  # LimitNOFILE=65535
  RestartSec=2s
  Type=simple
  User=git
  Group=git
  WorkingDirectory=/home/git/gitea
  ExecStart=/home/git/gitea/gitea web
  Restart=always
  Environment=USER=git
  HOME=/home/git
  [Install]
  WantedBy=multi-user.target

Save the file and quit the editor. Now gitea has become a service. Enable and start it

  sudo systemctl enable gitea.service
  sudo systemctl start gitea.service
  

Configuration

You now have a gitea service up and running on the system. Everything else is done browser-wise. Simply connect your favorite browser (in my case that happens to be chromium) to port 3000. The configuration should be obvious.

Annuntio vobis gaudium maximum: Habemus gitea 😄

installation_guides/gitea_on_raspberry_pi.txt · Last modified: 2020/05/23 21:17 by jupp