Installing Apostrophe on Ubuntu Server

In this tutorial, we will walk you through the steps to installing and configuring Apostrophe CMS on an Ubuntu Server machine.

Prerequisites

Before we begin the installation process, ensure that your Ubuntu machine has the following pre-requisites installed:

Install Node.js

Apostrophe CMS requires Node.js runtime environment. Install Node.js using the following commands:

  1. Update your package manager:

    $ sudo apt-get update
    
  2. Install Node.js:

    $ sudo apt install nodejs
    
  3. Check the installed version of Node.js:

    $ node -v
    

    If the installation is successful, you should see the version number of the installed Node.js.

Install MongoDB

MongoDB is the primary database backend used by Apostrophe CMS. To install MongoDB on your machine, use the following commands:

  1. Import MongoDB key:

    $ wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
    
  2. Create the MongoDB list file:

    $ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
    
  3. Update the package lists:

    $ sudo apt-get update
    
  4. Install the MongoDB Community Edition:

    $ sudo apt-get install -y mongodb-org
    
  5. Start MongoDB and enable it to start on boot:

    $ sudo systemctl start mongod
    $ sudo systemctl enable mongod
    
  6. Verify that the service is running:

    $ sudo systemctl status mongod
    

If the installation is successful, the status should show active (running).

Install ImageMagick and GraphicsMagick

Apostrophe CMS uses ImageMagick and GraphicsMagick for image processing. Install both packages using the following command:

$ sudo apt-get install imagemagick graphicsmagick

Install Apostrophe CMS

  1. Install the Apostrophe CLI tool globally:

    $ sudo npm install -g apostrophe-cli
    
  2. Create and navigate to the directory where you want to store your Apostrophe CMS project:

    $ mkdir apostrophe
    $ cd apostrophe
    
  3. Create a new Apostrophe project:

    $ apostrophe create-project my-project
    

    This command will generate a new Apostrophe project in the my-project directory.

  4. Change directory to the newly created project:

    cd my-project
    
  5. Start the development server:

    $ npm run dev
    

    This command will start the Apostrophe CMS instance on your local machine.

  6. Navigate to http://localhost:3000 on your web browser to access your newly installed Apostrophe CMS.

Conclusion

Congratulations! We have successfully installed Apostrophe on Ubuntu Server. You can now start developing your website with Apostrophe CMS.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!