Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Mastodon
  3. How to install Elasticsearch on Mastodon?

How to install Elasticsearch on Mastodon?

Scheduled Pinned Locked Moved Mastodon
42 Posts 13 Posters 4.5k Views 13 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    username
    wrote on last edited by
    #1

    Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

    https://docs.joinmastodon.org/admin/optional/elasticsearch/


    I'll describe my installation process and the problems I encountered.

    First connect to the VPS using Terminal on Mac.

    type:

    apt install openjdk-8-jre-headless
    

    The result is

    1.png

    Then I deleted the file according to the path. This code works again.

    2.png

    Enter code:

    wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
    

    Message:

    gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
    gpg: can't connect to the agent: No such file or directory
    

    To solve the above problem, I use apt install gpg-agent.

    again

    wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
    

    Enter code:

    echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
    
    apt update && apt install elasticsearch
    

    Then turn Mastodon off and on again in Cloudron.

    Modify the .env.production file.

    ES_ENABLED=true
    ES_HOST=localhost
    ES_PORT=9200
    

    Turn Mastodon off and on again in Cloudron.

    Finally at this step it does not work.

    RAILS_ENV=production bundle exec rake chewy:upgrade
    

    Terminal Tips

    -bash: bundle: command not found
    
    girishG 1 Reply Last reply
    1
    • U username

      Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

      https://docs.joinmastodon.org/admin/optional/elasticsearch/


      I'll describe my installation process and the problems I encountered.

      First connect to the VPS using Terminal on Mac.

      type:

      apt install openjdk-8-jre-headless
      

      The result is

      1.png

      Then I deleted the file according to the path. This code works again.

      2.png

      Enter code:

      wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
      

      Message:

      gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
      gpg: can't connect to the agent: No such file or directory
      

      To solve the above problem, I use apt install gpg-agent.

      again

      wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
      

      Enter code:

      echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
      
      apt update && apt install elasticsearch
      

      Then turn Mastodon off and on again in Cloudron.

      Modify the .env.production file.

      ES_ENABLED=true
      ES_HOST=localhost
      ES_PORT=9200
      

      Turn Mastodon off and on again in Cloudron.

      Finally at this step it does not work.

      RAILS_ENV=production bundle exec rake chewy:upgrade
      

      Terminal Tips

      -bash: bundle: command not found
      
      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @username said in How to install Elasticsearch on Mastodon?:

      Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

      You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

      R jdaviescoatesJ shanelord01S 3 Replies Last reply
      3
      • girishG girish

        @username said in How to install Elasticsearch on Mastodon?:

        Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

        You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

        R Offline
        R Offline
        redegelde
        wrote on last edited by
        #3

        @girish any time frame for that, additional packages
        Would be great

        1 Reply Last reply
        2
        • girishG girish

          @username said in How to install Elasticsearch on Mastodon?:

          Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

          You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

          jdaviescoatesJ Offline
          jdaviescoatesJ Offline
          jdaviescoates
          wrote on last edited by
          #4

          @girish said in How to install Elasticsearch on Mastodon?:

          At some point we do plan to integrate ElasticSearch into Cloudron.

          That would be very helpful and useful.

          @girish said in How to install Elasticsearch on Mastodon?:

          apps like nextcloud require this as well

          yeah Elasticsearch is needed to get proper full text search working on Nextcloud.

          I use Cloudron with Gandi & Hetzner

          F 1 Reply Last reply
          2
          • jdaviescoatesJ jdaviescoates

            @girish said in How to install Elasticsearch on Mastodon?:

            At some point we do plan to integrate ElasticSearch into Cloudron.

            That would be very helpful and useful.

            @girish said in How to install Elasticsearch on Mastodon?:

            apps like nextcloud require this as well

            yeah Elasticsearch is needed to get proper full text search working on Nextcloud.

            F Offline
            F Offline
            felipebaez
            wrote on last edited by
            #5

            @girish any chance ElasticSearch could be added to Mastodon any time soon? As instances grow and more people flock to Mastodon, this becomes an ever more important feature to have.

            girishG 1 Reply Last reply
            2
            • F felipebaez

              @girish any chance ElasticSearch could be added to Mastodon any time soon? As instances grow and more people flock to Mastodon, this becomes an ever more important feature to have.

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #6

              @felipebaez it's planned to add an elasticsearch addon but I don't have an ETA. For now, the best bet is to have a elasticsearch outside Cloudron and configure mastodon to use it.

              Elasticsearch is quite the beast with memory requirements, so we have to look into how it will fit.

              ei8fdbE 1 Reply Last reply
              2
              • girishG girish

                @username said in How to install Elasticsearch on Mastodon?:

                Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

                You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

                shanelord01S Offline
                shanelord01S Offline
                shanelord01
                wrote on last edited by
                #7

                @girish said in How to install Elasticsearch on Mastodon?:

                @username said in How to install Elasticsearch on Mastodon?:

                Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

                You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

                I've just tried getting an external Linode running Elasticsearch running with my Cloudron Mastodon server. No luck. Got the server running, but no idea how to get the Cloudron Mastodon server to connect and create the "ElasticSearch indices and fill them with data".

                Anyone got any guidance/steps on how to get this working?

                Tried this but no luck: https://docs.joinmastodon.org/admin/optional/elasticsearch/

                A 1 Reply Last reply
                0
                • shanelord01S shanelord01

                  @girish said in How to install Elasticsearch on Mastodon?:

                  @username said in How to install Elasticsearch on Mastodon?:

                  Do I need an external server, or should I install an elasticsearch app on Cloudron, or can I install it directly from the Ubuntu via code.

                  You will need an external server because we don't support installing additional packages on the server since it might break updates. At some point we do plan to integrate ElasticSearch into Cloudron. I think some other apps like nextcloud require this as well. For the moment, just install it on a ubuntu or equivalent outside Cloudron.

                  I've just tried getting an external Linode running Elasticsearch running with my Cloudron Mastodon server. No luck. Got the server running, but no idea how to get the Cloudron Mastodon server to connect and create the "ElasticSearch indices and fill them with data".

                  Anyone got any guidance/steps on how to get this working?

                  Tried this but no luck: https://docs.joinmastodon.org/admin/optional/elasticsearch/

                  A Offline
                  A Offline
                  alwynispat
                  wrote on last edited by
                  #8

                  @shanelord01 I've got mine working. It's only advisable to have it running from with in the same server otherwise you'll have to expose it to the internet.
                  I'm hosting my ES in docker but its similar.

                  Here's what I've done:

                  1. Set your network.host and discovery.seed_hosts to 0.0.0.0, this is so that it'll be open to the internet
                  2. Set your Port to something other than 9200, 9920 for example.
                  3. Ensure that your firewall/port forwarding is setup.
                  4. Configure your env.production
                  ES_ENABLED=true
                  ES_HOST=[ES IP Address]
                  ES_PORT=9920
                  
                  1. I recommend a reboot of the app
                  2. Run bin/tootctl search deploy in the app terminal

                  Find me at Mastodon

                  1 Reply Last reply
                  2
                  • girishG girish

                    @felipebaez it's planned to add an elasticsearch addon but I don't have an ETA. For now, the best bet is to have a elasticsearch outside Cloudron and configure mastodon to use it.

                    Elasticsearch is quite the beast with memory requirements, so we have to look into how it will fit.

                    ei8fdbE Offline
                    ei8fdbE Offline
                    ei8fdb
                    wrote on last edited by
                    #9

                    @girish said in How to install Elasticsearch on Mastodon?:

                    planned to add an elasticsearch addon

                    As an add-on? πŸ€” Are you hinting at something new? Or did I miss something about Cloudron add-ons? πŸ˜‰

                    1 Reply Last reply
                    1
                    • nichu42N Offline
                      nichu42N Offline
                      nichu42
                      wrote on last edited by nichu42
                      #10

                      The demand for ElasticSearch is about to increase rapidly very soon:
                      Full text search has just been merged in Mastodon main branch, and will be in the next version 4.2.0 (planned release date: 1st half of September).

                      https://github.com/mastodon/mastodon/pull/26344

                      Matrix: @nichu42:blueplanet.social

                      shanelord01S 1 Reply Last reply
                      3
                      • nichu42N nichu42

                        The demand for ElasticSearch is about to increase rapidly very soon:
                        Full text search has just been merged in Mastodon main branch, and will be in the next version 4.2.0 (planned release date: 1st half of September).

                        https://github.com/mastodon/mastodon/pull/26344

                        shanelord01S Offline
                        shanelord01S Offline
                        shanelord01
                        wrote on last edited by
                        #11

                        @nichu42 Completely agree. Perhaps it’s time for a package including both (or at least instructions on hire to set it up).

                        Personally I’d prefer a one stop all in one install.

                        1 Reply Last reply
                        2
                        • nichu42N Offline
                          nichu42N Offline
                          nichu42
                          wrote on last edited by
                          #12

                          Now that 4.2.0 has been released, what's the plan / progress with ElasticSearch, @girish?

                          Matrix: @nichu42:blueplanet.social

                          R 1 Reply Last reply
                          1
                          • nichu42N nichu42

                            Now that 4.2.0 has been released, what's the plan / progress with ElasticSearch, @girish?

                            R Offline
                            R Offline
                            redegelde
                            wrote on last edited by
                            #13

                            @nichu42 and when does 4,2 become available .
                            Great new updates

                            nichu42N 1 Reply Last reply
                            0
                            • R redegelde

                              @nichu42 and when does 4,2 become available .
                              Great new updates

                              nichu42N Offline
                              nichu42N Offline
                              nichu42
                              wrote on last edited by
                              #14

                              @redegelde It already is available on Github. I suppose the Cloudron package will follow shortly. The Cloudron team is usually very quick with providing updates.

                              Matrix: @nichu42:blueplanet.social

                              1 Reply Last reply
                              1
                              • scookeS Offline
                                scookeS Offline
                                scooke
                                wrote on last edited by
                                #15

                                I don't blame the Staff for not implementing this (yet). The RAM requirements are simply huge. Even as an add-on, how many users are going to "add this on" and then watch their Cloudron go down in flames. Imagine the Forum then! And then we'll all be asking/demanding/pleading with the Staff to fix it, tweak it, optimize it, "it should be clearer that I need a 16GB ram machine for Cloudron" complaints that will probably even turn into "don't use CLourdon, it's a memory beast" posts here and there. If anything, it would be nice if Cloudron just made it simpler to connect to an ES install.

                                A life lived in fear is a life half-lived

                                nichu42N 1 Reply Last reply
                                3
                                • scookeS scooke

                                  I don't blame the Staff for not implementing this (yet). The RAM requirements are simply huge. Even as an add-on, how many users are going to "add this on" and then watch their Cloudron go down in flames. Imagine the Forum then! And then we'll all be asking/demanding/pleading with the Staff to fix it, tweak it, optimize it, "it should be clearer that I need a 16GB ram machine for Cloudron" complaints that will probably even turn into "don't use CLourdon, it's a memory beast" posts here and there. If anything, it would be nice if Cloudron just made it simpler to connect to an ES install.

                                  nichu42N Offline
                                  nichu42N Offline
                                  nichu42
                                  wrote on last edited by nichu42
                                  #16

                                  @scooke Thanks for the insights. I use Cloudron because it's very easy to use, not to save money. So I'm open to whichever solution they work out. If there won't be a solution from Cloudron, I'd appreciate if the team would let us know. I'd start finding one myself in that case, though that's an adventure I try to avoid.

                                  Matrix: @nichu42:blueplanet.social

                                  girishG 1 Reply Last reply
                                  1
                                  • nichu42N nichu42

                                    @scooke Thanks for the insights. I use Cloudron because it's very easy to use, not to save money. So I'm open to whichever solution they work out. If there won't be a solution from Cloudron, I'd appreciate if the team would let us know. I'd start finding one myself in that case, though that's an adventure I try to avoid.

                                    girishG Offline
                                    girishG Offline
                                    girish
                                    Staff
                                    wrote on last edited by
                                    #17

                                    @nichu42 you should already be able to connect an external ES instance. I think this is the best way if you badly need this now.

                                    For integrating with cloudron, ES is a beast with its memory requirements as @scooke pointed out. It will take us a while to get to it and needs much thought. It's not in immediate roadmap.

                                    nichu42N 1 Reply Last reply
                                    2
                                    • girishG girish

                                      @nichu42 you should already be able to connect an external ES instance. I think this is the best way if you badly need this now.

                                      For integrating with cloudron, ES is a beast with its memory requirements as @scooke pointed out. It will take us a while to get to it and needs much thought. It's not in immediate roadmap.

                                      nichu42N Offline
                                      nichu42N Offline
                                      nichu42
                                      wrote on last edited by
                                      #18

                                      @girish Thanks for the clarification!

                                      Matrix: @nichu42:blueplanet.social

                                      girishG 1 Reply Last reply
                                      1
                                      • nichu42N nichu42

                                        @girish Thanks for the clarification!

                                        girishG Offline
                                        girishG Offline
                                        girish
                                        Staff
                                        wrote on last edited by girish
                                        #19

                                        @nichu42 I was just looking at it briefly. In case you go down this route... For some reason, they only support ES7 per https://github.com/mastodon/mastodon/issues/26544#issuecomment-1684005007 which is almost https://www.elastic.co/support/eol .

                                        Also, Nextcloud ES integration now requires ES8 which could conflict with the previous ES7 requirement.

                                        Finally, https://github.com/mastodon/mastodon/issues/18535 suggests OpenSearch 2.4.x might be supported.

                                        Let me if you come up with something!

                                        jdaviescoatesJ 1 Reply Last reply
                                        2
                                        • R Offline
                                          R Offline
                                          redegelde
                                          wrote on last edited by
                                          #20

                                          great work.
                                          For the time frame, when will Elasticsearch become avaible or not
                                          i understand this is needed with the 4.2 version

                                          jdaviescoatesJ 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Bookmarks
                                          • Search