Project

General

Profile

Support #988

Updated by Daniel Curtis 2 days ago

This is a guide on setting up Pocket ID on FreeBSD 14. 

 h2. Prepare the Environment 

 * Before installation of the components, make sure everything is up to date using the following command: 
 <pre> 
 pkg update -f && pkg upgrade 
 </pre> 

 h3. Create PostgreSQL Databases and Users 

 * Log in to postgresql user account 
 <pre> 
 su - pgsql 
 </pre> 

 * Connect to postgresql database 
 <pre> 
 psql -d template1 
 </pre> 

 * Create a user and database for Pocket ID: 
 <pre> 
 CREATE USER pocketiduser WITH PASSWORD 'SuperSecretPassword' CREATEDB; 

 CREATE DATABASE pocketiddb OWNER pocketiduser; 
 </pre> 

 * Quit postgresql and exit the user: 
 <pre> 
 \q 
 exit 
 </pre> 

 h2. Install Pocket ID 

 * Install the package: 
 <pre> 
 pkg install pocket-id 
 </pre> 

 * Create the key file: 
 <pre> 
 openssl rand -base64 32 > /usr/local/etc/pocket-id.key 
 </pre> 

 * Edit the config: 
 <pre> 
 vi /usr/local/etc/pocket-id.env 
 </pre> 
 #* And add the following: 
 <pre> 
 APP_URL=https://oauth2.example.com 
 ENCRYPTION_KEY_FILE=/usr/local/etc/pocket-id.key 
 DB_PROVIDER=postgres 
 DB_CONNECTION_STRING=postgres://pocketiduser:SuperSecretPassword@localhost:5432/pocketiddb 
 </pre> 

 * Set the permissions for the config and key file: 
 <pre> 
 chown pocket-id:pocket-id /usr/local/etc/pocket-id.env 
 chown pocket-id:pocket-id /usr/local/etc/pocket-id.key 
 chmod 600 /usr/local/etc/pocket-id.key 
 </pre> 

 * Start and enable on boot: 
 <pre> 
 sysrc pocket_id_enable=YES 
 service pocket-id start 
 </pre> 
 *NOTE* : I needed to edit @/usr/local/etc/rc.d/pocket-id@ and change +pocket_id_chdir+ to "/var/db/pocket-id/data". 

 h2. Resources 

 * https://github.com/pocket-id/pocket-id 
 * https://www.freshports.org/www/pocket-id 
 * https://pocket-id.org/docs/setup/installation 

Back