Linux (recommended)¶
These instructions are intended for the person who administers the instance, usually a more technical/operational profile.
Prerequisites (Ubuntu)¶
- Install dependencies:
- Add your user to the Docker group:
- Log out and log back in to apply the group permission.
Note:
- If you do not have root permissions, use
sudowhen necessary.
Installation¶
- Download the repository and enter the folder:
- Start Farinha:
On the first run, run.sh:
- creates the
.envfile automatically from.env-sample; - asks for the public Farinha address (in Portuguese and English). If you do not know it yet, press
Enterto leave it blank and continue; you can edit.envlater; - generates a safe
SECRET_KEY, without requiring Django to be installed on the server; - creates an
adminuser with a random password, shown on the console only once. Write down the password before closing the terminal.
The automatic key does not contain $. If you create a SECRET_KEY manually and it contains $, the script warns that Docker Compose may interpret this character as an environment variable and offers to generate a new safe key.
To determine which environment will be used (development or production), the script reads the ENV variable from .env. .env-sample ships with ENV=prod and DEBUG=False, which are appropriate values for a real installation.
HTTPS and certificates¶
Farinha uses Caddy to serve HTTPS:
- With a public address configured, free certificates are obtained and renewed automatically.
- To use your own certificates, place
fullchain.pemandprivkey.pemin thecerts/folder at the project root. - Without a public address and without your own certificates (for example,
localhost), HTTPS is disabled automatically.
See the details in Security and HTTPS, including the DISABLE_HTTPS variable and bot protection (Anubis).
Optional manual adjustment¶
If you need to review or change settings, open .env with your preferred text editor:
Updating¶
- Enter the folder where Farinha was installed:
- Stop, update, and start again:
Good practices¶
- Write down the
adminuser password shown on the first run; it is not displayed again. - Keep
DEBUG=Falsein.envin real installations. - Back up the database (
db/) before updates and keep thecerts/folder if you use your own certificates. - Prefer updating by stopping and starting everything again (
down+pull+run), rather than recreating a single container.
Common problems¶
- “permission denied” when using Docker: your user is not in the Docker group. Run
sudo usermod -aG docker $USERand log out/log back in (or usesudo, when appropriate). - The script stops without starting: check that
SECRET_KEYis present in.envand does not contain$. - I lost the
adminuser password: create another superuser from the terminal, inside the container:
- I can only access via HTTP: with
localhostor an IP, HTTPS is disabled; configure a domain or your own certificates. See Security and HTTPS. - The internal panel does not open at
/admin/: someone may have changedADMIN_PATHin.env. See SuperAdmin user.