Forem Creators and Builders 🌱

Cover image for Production: Installing Forem using t2d script.
Akhil Naidu
Akhil Naidu

Posted on • Updated on

Production: Installing Forem using t2d script.

Update

Read this article to get familiar with t2d and checkout this post, which contains a video tutorial on how to install Forem.

The new post consists of New version of t2d with intuitive TUI. This doesn't mean the script below doesn't work!

Few Screenshots from the updated t2d.

1
2
3

With a few clicks and necessary ENV variables, you can configure Forem without any issues.

I spent a lot of time writing this script, both to automate my Forem and to make Forem available for non-tech community admins, like this community. Both of these communities are installed using this script.

Till now, this t2d script was used in deploying two Forem instances. If you used this script and have a successful install; let me know; I will update those here :)

Prerequisites

  1. Dokku installed VPS, with a minimum of 2GB of RAM. In my opinion, choosing a 10$ Droplet within your region is an essential requirement. The best VPS configuration would be 2 CPUs with 8GB RAM => Can handle a lot. A lot means a lot.
  2. While configuring Dokku in your VPS, you will be prompted to choose a hostname after it's boot using an IP address. use your IP address here to make it more compatible with t2d.
  3. Now, point out your domain (or subdomain) to this IP using an A address.
  4. For you to install Forem without any issues, you need to have few ENV variables with you; I mentioned them at the end of this article.
  5. Download this script in your VPS. Within your VPS, use this command to download the script: wget https://raw.githubusercontent.com/akhil-naidu/t2d/master/t2d.sh
  6. Now use this command to interact with the script: bash t2d.sh

Always remember the name of the script; it is t2d => Talk to dokku, so you need to read thoroughly before proceeding to the next step.

The bash t2d.sh command with your interaction will make sure that you have downloaded and installed all the requirements. I'm also attaching few screenshots.

capture 1
capture 2
capture 3
capture 4
capture 5

Now you can start installing Forem without any issues if you have these ENV variables.

t2d

Simple Briefing

  • The script is ready and working in the beta stage.
  • Only Forem Automation will work for now
  • Manual Dokku installation is our next plans

For a user to have a successful Forem installation, these are the prerequisites:

  1. Dokku in your Digital Ocean Droplet or VPS.
  2. Your DNS should point to the IP address of Digital Ocean or VPS IP Address.
  3. The user needs to provide the below-mentioned ENV variables during the installation.

ENV Variables (Must Have) (Will be configured as user input)

APP_DOMAIN
APP_PROTOCOL
COMMUNITY_NAME
FOREM_OWNER_SECRET
HONEYBADGER_API_KEY
HONEYBADGER_JS_API_KEY
AWS_ID
AWS_SECRET
AWS_BUCKET_NAME
AWS_UPLOAD_REGION

ENV Variables (Automatically Configured)

DATABASE_URL
REDIS_URL
DATABASE_POOL_SIZE
RAILS_MAX_THREADS
NODE_ENV
RACK_ENV
RACK_ENV
SECRET_KEY_BASE
MALLOC_ARENA_MAX
JEMALLOC_ENABLED
WEB_CONCURRENCY
RUBY_GC_HEAP_GROWTH_FACTOR
PGBOUNCER_PREPARED_STATEMENTS

What's Next

  • I am adding a manual function for you to add environmental variables on your own and by using an ENV.txt file.
  • Adding manual setup for you to talk with the entire dokku CLI
  • The rest is up to you; comment below or raise an issue here.

If you find any typos, please let me know; Until I have this zoomed out look in the preview cover, I never realised about such typos.

Updates

Adding ENV variables Manually, this will help users to setup the remaining ENV variables like adding Cloudinary API keys, Fastly, Honeycomb, ...

capture 7

Repository

GitHub logo leewardslope / t2d

TUI for Dokku-CLI

What is t2d?

t2d aka Talk to Dokku; is a beautiful Terminal User Interface(TUI) powered by dokku. With t2d you will be able to deploy apps in most popular programming languages, link them to most popular databases and all that with almost zero configuration from your side. Apart from all these amazing features it will also save you money along the way.

Our Vision

We started to work on this because current deployment solutions were expensive or hard to configure. With t2d we plan to provide a solution where deployment experience is smooth, enjoyable and affordable.

What is Dokku?

Dokku is Docker-powered Heroku-like tool that allows you to deploy complex applications by simply pushing it via Git repository. Behind the scenes it runs on herokuish, which essentially is emulating same functionalities that you are using when you deploy your apps on Heroku. As it supports all the Heroku buildpacks, it…

Latest comments (9)

Collapse
 
riderdivyanshu profile image
riderdivyanshu

@akhil I am trying to install FOREM in ubuntu 20 by trying t2d method by it is showing me error and setup get stop.

Can you help me on this how can i install it

Collapse
 
duyasia profile image
Duy Nguyen

Hi @akhil ,
How can I backup and restore my Forem on t2d. Please guide me. Thank

Collapse
 
duyasia profile image
Duy Nguyen

Or can I backup and restore my Forem in any other way. I want to move my Forem server to another provider. Thank you

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
akhil profile image
Akhil Naidu

I've been working on a web app to install Forem via the browser. The Web App will be live in few weeks, you can look at the progress here: selfhost.dev

With this Web App, you can upload you PostgresdB backup's to s3 storage. You can even create cron jobs to periodically backup your Forem and also roll back to a certain backup file, in case if you prefer to.

Collapse
 
duyontheway profile image
Duy

Thank you for your instruction @akhil !
I'm wondering how can we upgrade Forem and will it run smoothly with new updates?

Collapse
 
akhil profile image
Akhil Naidu • Edited

I'm creating a more versatile script which makes me update the script fast. It will be out in few hours. With that script you can update your VPS, Ddokku, Forem without any downtime.

Let me know if you want any other features, I will add them too.

Collapse
 
duyontheway profile image
Duy

That's awesome!

Collapse
 
akhil profile image
Akhil Naidu • Edited

Updated to v2; now you can manually add ENV variables of your choice.

After initial configuration you will have a working Forem, but you might need to updated your ENV variables, so rather than reinstalling everything using the auto-script you can use this feature.

All the updates will be pointed under the updates section of the post