# Set up Discourse for development on Fedora Linux

**URL:** https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348
**Category:** Developer Guides
**Tags:** dev-install, how-to
**Created:** [September 8, 2020, 11:00am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348 "2020-09-08T11:00:32Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [September 8, 2020, 11:00am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/1 "2020-09-08T11:00:32Z")

</div>

This guide has been tested against a fresh install of Fedora 31 and 33, but may work on older versions that also use dnf as the package management tool. This is not an official guide but may be useful for other developers using Fedora. This is largely based on the [Ubuntu development guide](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727), with changes for the different packages for dnf. The assumption is that you do not have any of the packages installed already, although most will be skipped by the tooling if it is already installed.

If you’re looking to install Discourse for a **production environment** , prefer the [docker install instructions on github](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md).

**Install required system and development packages**

```sh
sudo dnf update
sudo dnf install -y "@development-tools" git rpm-build zlib-devel ruby-devel readline-devel libpq-devel ImageMagick vips sqlite sqlite-devel nodejs npm curl gcc g++ bzip2 openssl-devel libyaml-devel libffi-devel zlib-devel gdbm-devel ncurses-devel optipng pngquant jhead jpegoptim gifsicle oxipng

```

**Install required npm packages**

```sh
sudo npm install -g svgo pnpm

```

**Install and setup postgres**

```sh
sudo dnf install postgresql-server postgresql-contrib
sudo postgresql-setup --initdb --unit postgresql
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo -u postgres -i createuser -s $USER

```

**Install and setup redis**

```sh
sudo dnf install redis
sudo systemctl enable redis
sudo systemctl start redis

```

**Installing rbenv, ruby-build, and ruby**

```sh
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
~/.rbenv/bin/rbenv init
printf 'export PATH="$HOME/.rbenv/bin:$PATH"\n' >> ~/.bashrc
printf 'eval "$(rbenv init - --no-rehash)"\n' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# confirm the install is correct
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
rbenv install 2.7.1
rbenv global 2.7.1
rbenv rehash

```

**Install Ruby dependencies**

```sh
gem update --system
gem install bundler mailcatcher rails

```

**Clone Discourse code**

```sh
git clone https://github.com/discourse/discourse.git ~/discourse
cd ~/discourse

```

**Install Discourse dependencies**

```sh
bundle install
pnpm install

```

**Create the required databases and load the schema**

```sh
bundle exec rake db:create db:migrate
RAILS_ENV=test bundle exec rake db:create db:migrate

```

**Test installation by running the tests**

```sh
bundle exec rake autospec

```

**Run the application**

```sh
bundle exec rails server

```

You should now be able to see the Discourse setup page at [http://localhost:3000](http://localhost:3000).

For further setup, see the [existing official install guides](https://meta.discourse.org/tag/dev-install).

* * *

This document is version controlled - suggest changes [on github](https://github.com/discourse/discourse/blob/main/docs/developer-guides/docs/02-development-environments/10-fedora-setup.md).

---

<div class="post-metadata">

### Author: ![nicolas-jaussaud](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nicolas-jaussaud/32/240106_2.png) [@nicolas-jaussaud](https://meta.discourse.org/u/nicolas-jaussaud)
#### Post date: [November 15, 2021, 4:20pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/14 "2021-11-15T16:20:00Z")

</div>

In _Installing rbenv, ruby-build, and ruby_, the url to the rbenv-doctor script is not working anymore (apparently the branch has been rename from master to main), the correct command is now:

```plaintext
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash

```

---

<div class="post-metadata">

### Author: ![fitzy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fitzy/32/192549_2.png) [@fitzy](https://meta.discourse.org/u/fitzy)
#### Post date: [November 15, 2021, 10:40pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/15 "2021-11-15T22:40:07Z")

</div>

Thanks for the info @nicolas-jaussaud, I’ve updated the OP.

FWIW I now prefer to use [`chruby`](https://github.com/postmodern/chruby) and [`ruby-install`](https://github.com/postmodern/ruby-install) over `rbenv`.

---

<div class="post-metadata">

### Author: ![Boost](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@Boost](https://meta.discourse.org/u/Boost)
#### Post date: [May 1, 2023, 11:20am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/16 "2023-05-01T11:20:12Z")

</div>

I ran into an issue trying to run `bundle install` as Fedora now has by default disabled file transport.

The error happens when trying to install the sprockets gem and ends with the message:

```plaintext
transport 'file' not allowed

```

I don’t know what’s the proper way to do this, but you can temporarily allow the unsafe transport:

```plaintext
git config --global protocol.file.allow always
# run the discourse setup here
git config --global protocol.file.allow never

```

After that I ran into an error like this when running `db:migrate`:

```plaintext
At /home/hhyyrylainen/Projects/discourse/lib/site_setting_extension.rb:199:in `public_send`
Deprecation notice: `SiteSetting.enable_personal_messages` has been deprecated. Please use `SiteSetting.personal_message_enabled_groups` instead. (removal in Discourse 3.0) 
At /home/hhyyrylainen/Projects/discourse/lib/site_setting_extension.rb:199:in `public_send`
#<Thread:0x00007f94c3342600 /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:83 run> terminated with exception (report_on_exception is true):
/home/hhyyrylainen/.gem/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_handling.rb:309:in `connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
	from /home/hhyyrylainen/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management/rails_61_compat.rb:8:in `current'
	from /home/hhyyrylainen/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:115:in `current_db_hostnames'
	from /home/hhyyrylainen/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:111:in `current_hostname'
	from /home/hhyyrylainen/Projects/discourse/lib/discourse.rb:232:in `handle_job_exception'
	from /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:114:in `rescue in do_work'
	from /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:113:in `do_work'
	from /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:85:in `block (2 levels) in start_thread'
/home/hhyyrylainen/.gem/ruby/3.2.0/gems/activerecord-7.0.4.3/lib/active_record/connection_handling.rb:309:in `connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
	from /home/hhyyrylainen/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:79:in `with_connection'
	from /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:96:in `do_work'
	from /home/hhyyrylainen/Projects/discourse/lib/scheduler/defer.rb:85:in `block (2 levels) in start_thread'

```

It seems it happened after the migration finished, so as I couldn’t figure out how to fix that I ignored it, but luckily my development site seems to be working.

For the test environment I didn’t get the same error but got an error about missing oxipng, which doesn’t seem to be available as a Fedora package.

After that I didn’t run into any more issues, everything still more or less worked fine on Fedora 38. Though, I had previously installed rbenv using some other setup instructions.

Running `bundle exec rake autospec` I got some test failures (135) but it seems I got a mostly working development setup.

---

<div class="post-metadata">

### Author: ![philip\_rhoades](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philip_rhoades/32/114647_2.png) [@philip\_rhoades](https://meta.discourse.org/u/philip_rhoades)
#### Post date: [May 2, 2023, 11:14pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/17 "2023-05-02T23:14:40Z")

</div>

I got the Dev version going some time ago but the Production version was too difficult for me . .

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [October 14, 2024, 5:24pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/18 "2024-10-14T17:24:49Z")

</div>

Just followed this guide to install on Fedora 40 Workstation, had to add _oxipng_ to the distro installs.  
`sudo dnf install oxipng`

---

<div class="post-metadata">

### Author: ![fitzy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fitzy/32/192549_2.png) [@fitzy](https://meta.discourse.org/u/fitzy)
#### Post date: [October 15, 2024, 3:21am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/19 "2024-10-15T03:21:34Z")

</div>

Thanks for letting us know, I’ve updated the documentation in this commit: [docs/fedora-setup: include oxipng package (#14) · discourse/discourse-developer-docs@eb51e54 · GitHub](https://github.com/discourse/discourse-developer-docs/commit/eb51e543efb91b4efb1974625e69c41846832039).

---

<div class="post-metadata">

### Author: ![opcourdis](https://avatars.discourse-cdn.com/v4/letter/o/45deac/32.png) [@opcourdis](https://meta.discourse.org/u/opcourdis)
#### Post date: [January 1, 2025, 8:00pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/20 "2025-01-01T20:00:42Z")

</div>

I am stuck after installation today on Fedora 41 with the following issue when I connect to localhost:3000 and click on register :  
“no administrator emails were defined during setup”; the message provides how to add an administrator email.

> [@Create an admin account from the console](https://meta.discourse.org/t/create-an-admin-account-from-the-console/17274):
>
> bookmark This guide provides instructions for creating an admin account or granting admin privileges using the console in a self-hosted Discourse installation. person_raising_hand Required user level: System Administrator warning Console access required So you want to create/grant Admin privileges or reset user password from console? Great, let’s get started! This guide will cover the following: Accessing the console Creating a new account with admin privileges Resetting an existin…

I’ve failed to successfuly add an admin acount following this procedure because of 2 errors when using ./launcher enter app :  
1° First solved error was: no app.yml file is present → I copied the sampleapp.yml from the sample folder to the container folder, then modified to add email adresses, then did the rebuild with /var/discourse/launcher rebuild app  
2° Second error is not solved :  
Error response from daemon: No such container: app  
If I use the rake commands to create an admin it tells me no rakefile found

Can anyone please help?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 1, 2025, 8:21pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/21 "2025-01-01T20:21:27Z")

</div>

This install doesn’t use docker, so you can’t enter a container.

Try creating an admin from the Discourse folder with this command:

```bash
bin/rails admin:create

```

---

<div class="post-metadata">

### Author: ![opcourdis](https://avatars.discourse-cdn.com/v4/letter/o/45deac/32.png) [@opcourdis](https://meta.discourse.org/u/opcourdis)
#### Post date: [January 1, 2025, 8:30pm UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/22 "2025-01-01T20:30:44Z")

</div>

Hi Coconut, you are quick to respond and efficient, thanks a lot !  
The command returns gem bunder missing, which I installed with `gem install bundler -v 2.6.2’ and then I could successfuly apply your solution !

```plaintext

```

---

<div class="post-metadata">

### Author: ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)
#### Post date: [November 12, 2025, 10:46am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/23 "2025-11-12T10:46:02Z")

</div>

Just tried running a local install and ran into issues with pgvector. This is on Fedora 42 and Postgres16. The packaged version of pgvector is 0.6.2 and it seems I need to compile from source to get a more recent one.

Then ran into conflicts trying to build pgvector, which seems to require postgresql-private-devel package that had conflicting requests with libpq-devel.

Resolved it by:

- 

```plaintext
 sudo dnf install postgresql-server-devel --allowerasing

```

- Build [pgvector](https://github.com/pgvector/pgvector/)
- Check installed version

```plaintext
sudo -u postgres psql discourse_development -c "SELECT * FROM pg_available_extensions WHERE name = 'vector';"

```

- 

```plaintext
 sudo systemctl restart postgresql

```

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [June 1, 2026, 11:52am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/24 "2026-06-01T11:52:10Z")

</div>

> [@Discourse](#):
>
> This is not an official guide

![image](https://global.discourse-cdn.com/meta/original/4X/9/2/6/926c9733824038b037befcf958aff85c287934d2.png)

Soo… is this official? (That line should probably be removed, no?)

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [June 5, 2026, 8:25am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/25 "2026-06-05T08:25:11Z")

</div>

> [@Discourse](#):
>
> ```plaintext
> rbenv install 2.7.1
> rbenv global 2.7.1
> 
> ```

Pardon me, but is this version out of date? The most recent version of Ruby listed on `rbenv install -l` is 4.0.5 IIRC (as is the most recent version on [ruby-lang.org](http://ruby-lang.org))

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [June 19, 2026, 5:20am UTC](https://meta.discourse.org/t/set-up-discourse-for-development-on-fedora-linux/163348/26 "2026-06-19T05:20:22Z")

</div>

Running `bundle exec rails server`, it starts a whole bunch of migrations. It’s been running for about an hour and still not done. My laptop has enough RAM and CPU power for this, is this just because of the sheer amount of migrations needed to be run?

~~EDIT: 3 hours in and still going strong.  
EDIT #2: Into the 4th hour…~~  
EDIT #3: Me being me, I misread the console output for 4 hours and realised now that it’s not actually migrations running :facepalm: … it’s the Sidekiq jobs… and port 3000 actually shows the instance. No cause for alarm!
