Support #952
Install Gitea on FreeBSD
Status:
Closed
Priority:
Normal
Assignee:
Category:
Source Code Management
Target version:
Start date:
11/30/2020
Due date:
% Done:
100%
Estimated time:
Description
This is a guide for setting up Gitea with PostgreSQL on FreeBSD 12.
Prepare the Environment¶
- Make sure the system is up to date:
pkg update && pkg upgrade
Setup PostgreSQL¶
- Install PostgreSQL:
pkg install postgresql96-{client,server, contrib}
- Initialize, start, and enable postgresql at boot:
sysrc postgresql_enable="YES" service postgresql initdb service postgresql start
- Log in to postgresql user account and connect to database:
su - postgres psql -d template1
- Create a user:
CREATE USER gitea WITH PASSWORD 'SuperSecretPassword' CREATEDB;
- Create the database & grant all privileges on database
CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
- Quit the database session
\q exit
Setup Gitea¶
- Install the dependencies
pkg install gitea
- Edit the app.ini file:
vi /usr/local/etc/gitea/conf/app.ini
- Modify the following values:
[database] DB_TYPE = postgres HOST = 127.0.0.1:5432 NAME = giteadb PASSWD = SuperSecretPassword SSL_MODE = disable USER = gitea [server] DOMAIN = 192.168.0.54 HTTP_ADDR = 192.168.0.54 HTTP_PORT = 3000 ROOT_URL = http://192.168.0.54:3000/
- Modify the following values:
- Start and enable gitea:
sysrc 'gitea_enable=YES' service gitea start
- Open a web browser and go to http://192.168.0.54:3000