VisualEditor/Installation on a shared host

Jump to navigation Jump to search
Since 2019 the following instruction is no longer valid (see discussion page for more details)

VisualEditor requires a Parsoid service (using the Parsoid/Developer Setup here). Parsoid requires also Node.js running in the background at all times. Most shared-hosting companies don't provide this. If you cannot move your wiki to a dedicated hosting solution such as a VPS, then a workaround is to install Parsoid on a cloud platform which supports Node.js, such as Be aware that this is not an official hack.

  1. Install Extension:VisualEditor on your wiki as per usual (you can download it from here)
  2. Sign up with
  3. In the language choice section select node.js
  4. In your local computer, install the Heroku Command Line Interface as well as any dependencies (i.e node.js and npm).
  5. The first thing you should do when you installed Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating. So set your name and email with the following commands:
    git config --global "John Doe"
    git config --global
  6. Download Parsoid using this command:
    git clone
  7. After successfully downloading, go to Parsoid location on your disk (for example here "C:\parsoid").
  8. In Parsoid folder change the file .gitignore (this file is located between ".eslintrc" and "gitreview" file in Parsoid root folder). Here you need to remove the line config.yaml (11 line).
  9. Now you also need to change the file config.example.yaml. Open it and change uri (line 40) The "uri" is the URL to your API (normally this is in the root-folder and called api.php). Change this option according your wiki (for example or or something like that. For it is
    uri: ''
  10. Once you applied the changes save the file as config.yaml
  11. (RECOMMENDED) Then you need a config file to make Parsoid to work through HTTPS (skip ahead if you don't have https, to check if you have https, see if the padlock is green, if you skip this with https in your wiki, you will have an error while using it). Create file under /etc/stunnel/parsoid.conf
  12. Give the file similar content like this:
    cert = /etc/ssl/my_certs/parsoid.crt
    key = /etc/ssl/my_keys/mykey.key
    CAfile = /etc/ssl/my_ca/ca.crt
    accept  = 8143
    connect = 8142
    If you are using Let's Encrypt, you can use the following (replacing `<domain>` with the primary URL you have the certificate for):
    cert = /etc/letsencrypt/live/<domain>/fullchain.pem
    key = /etc/letsencrypt/live/<domain>/privkey.pem
    accept  = 8143
    connect = 8142
  13. Now, login to your heroku account by typing:
    heroku login
    Then sign in to your heroku account using your email address and password.
  14. To create a new app type in console:
    heroku create
  15. Then open your app on Heroku.
  16. In "Settings" tab edit the "Config Variables" and add the following parameters:
    KEY: NODE_ENV  VALUE: production
    KEY: Buildpack VALUE: nodejs
  17. Then from *inside the parsoid folder ("C:\parsoid\") add all files to your git repository: *Note: "Inside" It would mean, on the main parsoid folder from the command line. - For example: C:\parsoid> Or any other path where your parsoid folder is located.
    git init
    git add .
    git commit
  18. You'll see git editor. You can get out of it by typing the command :q. After this you are shown the message "Aborting commit due to empty commit message". Don't worry this is normal.
  19. Next, add your Heroku app as a Git remote:
    heroku git:remote -a appname
    git commit -m "Initial commit"
    git push heroku master
    Now you should get a positive response. If you do not get a positive answer at the push master stage, and something about PHP is mentioned as error, It is means that you have not set up a Node framework for your application on the Heroku panel. Fix it in the Settings tab, scroll down, and click the Add buildpack button. There you'll find the missing setting.
  20. Before you run your app set Heroku to run it with one dyno:
    heroku ps:scale web=1
  21. To test your installation open your app: URL is
  22. You should see a HTML-Page titled "Welcome to the Parsoid web service". which shows that Parsoid is working Problems that can crop up:
    1. Server error - This means that you have not installed the Node or NPM service properly on your computer. Perform various tests, and if you get an error at some point then reinstall.
    2. No error, you see the Heruku site on your app page - This means that you have not moved your parsoid folder properly in the Git stage. Make sure you do Section 17 here properly. If necessary, do it again.
  23. Now it's time to change your LocalSettings.php:
    wfLoadExtension( 'VisualEditor' );
    //Enable VisualEditor by default for everybody
    $wgDefaultUserOptions['visualeditor-enable'] = 1; 
    // Optional: Set VisualEditor as the default for anonymous users
    // otherwise they will have to switch to VE
    // $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
    // Don't allow users to disable it
    $wgHiddenPrefs[] = 'visualeditor-enable';
    // OPTIONAL: Enable VisualEditor's experimental code features
    #$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
    // Parsoid configuration
    $wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    // Use port 8142 if you use the Debian package
    // url must not end in a slash, otherwise it might give a 404 error
    'url' => '',
    // Parsoid "domain", see below (optional)
    'domain' => 'localhost',
    // Parsoid "prefix", see below (optional)
    'prefix' => 'your wiki prefix',
    //If you run a private wiki then you have to set the following variable to true:
    'forwardCookies' => true

Example Parsoid in Heroku[edit]


People, if you use the last edition of MediaWiki before 1.31, you need to add one more line on file: config.yaml

What will be added?

strictAcceptCheck: false

See the example bellow of config.yaml:

  1. services:
    - module: lib/index.js
      entrypoint: apiServiceWorker
          # For backwards compatibility, and to continue to support non-static
          # configs for the time being, optionally provide a path to a
          # localsettings.js file. See localsettings.example.js
          #localsettings: ./localsettings.js
          # Set your own user-agent string
          # Otherwise, defaults to:
          # 'Parsoid/<current-version-defined-in-package.json>'
          #userAgent: 'My-User-Agent-String'
          '''# /!\ COMPATIBILITY for Parsoid 0.9.0 with MediaWiki before 1.31'''
          '''strictAcceptCheck: false'''
          # Configure Parsoid to point to your MediaWiki instances.

Important: Change it on your local computer folder of parsoid and update it on Heroku:

Commands to update the parsoid on Heroku:

git add .

git commit -am "make it better"

git push heroku master

Have Fun!!

Thiago Godoy

Edit by: JohnGL4 (for sloving the http404 error)

See also[edit]

  1. Extension:TinyMCE

External resources[edit]

  1. Getting Started with Node.js over Heroku Manual