Install Discourse on Ubuntu or Debian for Development

I tried an Ubuntu 24 installation on WLS2. [1]

Here are the issues I ran into:

  • E: Unable to locate package libltdl7-dev

  • Your Ruby version is 3.2.1, but your Gemfile specified ~> 3.3
    With the ruby version bump to > 3.3 recently, the script needs an update as well: install-rails/linux at main · discourse/install-rails · GitHub

    • What I did:
      rbenv install 3.3.7
      rbenv global 3.3.7
      rbenv rehash
  • ERROR Unsupported engine for /home/arkshine/discourse: wanted: {"pnpm":"^9"} (current: {"node":"v18.20.6","pnpm":"10.5.2"})

    • sudo is needed: sudo pnpm install [2]
  • ERROR Failed to switch pnpm to v9.15.5. Looks like pnpm CLI is missing at "~/.local/share/pnpm/.tools/pnpm/9.15.5/bin" or is incorrect

    • When running pnpm install. I was able to fix with:
      • npm install -g corepack@latest
      • corepack use pnpm@latest-9

As non-root, the lack of sudo in the code makes it impossible to run at the end. I don’t know if there is a smart way, but I did not find it. I did not have these issues with Ubuntu 22.
As root, I was able to make it work.

As a side note, there is Developing Discourse using a Dev Container as an alternative.


  1. Because the Ruby bump version now requires v3.3+, I could not fix my installation with Ubuntu 22. ↩︎

  2. If you install as non-root. ↩︎

2 Likes