1. Head over to the Amazon Web Services
    site and sign up using your existing amazon account or create one.
  2. Go ahead and enter in your payment information. The way the Amazon free tier works is that if you go over a certain threshold they will charge you, but what we are setting up will be free and remain that way unless you get a lot of hits or server side data use Amazon EC2 Free Tier details
  3. Verify by phone and then on the next page, verify through your email once it arrives.
  4. Once you click the link in the email you got, go ahead and go to the AWS Management Console.
  5. Click on EC2 on the left side and wait for that email to come through (from previous setups I have had the email take anywhere from minutes to an hour to arrive).
  6. Once you get the email and your access to EC2 has been allowed, head to our Amazon AWS Marketplace page
    and click Continue.
  7. Amazon AWS Markeptlace - 1-Click Launch

  8. Along the left hand side select which region you want your EC2 instance to be in and what SSH Key Pair you want deployed on the server. Then click Launch with 1-Click.
  9. In the confirmation window click on the AWS Management Console link
  10. Amazon AWS Markeptlace - An instance of this software is now deploying on EC2

  11. Once your instance has an Instance State of “running” you will be able to browse to your Ghost instance and SSH into your server if you want to. Select your EC2 instance from the list and grab your Amazon EC2 Public DNS address.
  12. Amazon AMI - Public DNS

  13. You can now enter that web address into a browser and you will see your Ghost blog up and running!

Additional Steps

Your Ghost blog is up and running, so if you want to just test it out, thats great go ahead and use it. If you want to do some additional steps for added security, here are some common ones:

  • SSH into your EC2 instance:
    ssh -i /path/to/amazon/key.pem ec2-user@[public-dns]

    If you get the error: bad permissions: ignore key: /Users/davidb/Desktop/key.pem
    Permission denied (publickey). Do the following command

    sudo chmod 600 /path/to/amazon.pem
    

We hope this article helped you get your Ghost blog running on a free EC2 instance. For feature requests or feedback on our Amazon AMI please leave us a comment below.

143 thoughts on “How to Setup an Amazon EC2 Instance to Host Ghost for Free (AMI)

  1. Hi, I followed all steps. Installed the 32bits AMI

    When I go to /ghost/signup, got a message: “A user is already registered. ” And I can’t add another one.
    Seems there is one previously configured.
    How can I reset it?

    Reply
    • hmm, thats weird. I just launched another on to check, and it worked. What i would do is ssh into your server, delete your database, and restart ghost:

      ssh -i /path/to/your/amazon.pem ec2-user@your_amazon_url.com
      sudo rm /var/www/ghost/content/data/ghost.db
      sudo forever restartall

      Now go back to that page and you should be good to go.

      Reply
      • Thank for the fast reply.
        I only found the database on this path: /opt/bitnami/apps/ghost/htdocs/content/data/ghost.db

        Removed it, restarted and now get SQLITE_ERROR: no such table: users on signup

        Reply
        • Did you install Ghost through bitnami? I think you might have selected the wrong image on amazon. We copied our image over to all regions of amazon, but its not showing up in the search yet. Try stopping that instance, and creating a new one in US-West (Oregon). Our image should look like the one in the picture. Thats prob why there is a user cause its the bitnami image.

          Reply
          • Yes, in Oregons is the right image.
            That explains a lot of things… :D
            Thank you for the support!

          • Great!! Ya, we are not sure why its not in the other ones, but checking it out. Thanks!

  2. Changed the host address to ‘http://ec2-54-200-39-254.us-west-2.compute.amazonaws.com/’ but now the site does not load. Could a swap file be causing the problem?

    Reply
    • Hi Ben. I would start simple. If you can edit your config.js file and change the host address to 0.0.0.0. Once that is saved restart your instance and see if Ghost comes up. If it still does not work we can disable forever and try starting Ghost with npm start.

      Post back if you can’t get it sorted out and we can troubleshoot it more.

      Reply
    • Just thought of one more useful thing Ben.

      To view the forever / Ghost log you can run this command:

      tail -f /var/log/ghost

      If you see anything interesting in there post it and I can take a look.

      Reply
      • Andy:

        I created a new instance and went through the steps again. The one place that I am confused on is ‘url’ vs ‘host’. Should I change the ‘url’ to the amazon url?

        Also, I tried ‘sudo npm start’ with standard settings (host: 0.0.0.0 and port:80) and I’m getting a port in use error. The same when I tried port 22.

        events.js:72
        throw er; //Unhandled ‘error’ event

        Error: listen EADDRINUSE
        at errnoException (net.js:901:11)
        at Server.listen2 (net.js:1039:14)
        at listen (net.js:1061:10)
        at net.js:1135:9
        at dns.js:72:18
        at process.tickCallbal (node.js:415:13)
        npm ERR! weird error 8
        npm ERR! not ok code 0

        I am using PuTTY to ssh into the virtual server using port 22, but port 80 shouldn’t have conflicts.

        Reply
        • Error: listen EADDRINUSE means that the port you are trying to use is in use by something else. Are you using our image? If so, it is possible that Ghost may be already running. do ‘sudo forever list’ and see if it shows ghost running or not. If so, restart it by doing ‘sudo forever restartall’ and it will pull the new configs in your config.js

          Reply
    • Check out the first 2 bullets under ‘Additional Steps’. You have to ssh into your amazon instance and then edit the config.js. Those should help you out.

      Reply
      • Thanks – got it going. Delving into unix for the first time.
        Next question….
        Ok, so this might be a silly question, but where can I find documentation on markup
        TIA

        Reply
      • I successfully connected via ssh, but I don’t know where to find the config file. When I enter ‘ls’, nothing appears. If I enter ‘ls -R’, then only a period gets lists. What am I missing?

        Reply
  3. Finally got it running. I rebooted the instance and ran ‘sudo npm start’ with the ’0.0.0.0. and port 80′ configuration.

    Seems to be working fine now.

    Now just need to figure out how to secure it and install themes…

    Reply
  4. Had it working and now its showing a port in use error again. Had a screen running and then shut it down, uploaded a theme, and then tried to run npm start again and the same error is back. Just can’t win.

    Reply
  5. Just setup ghost using these instructions on an ec2 instance. Very clear! One thing I would add is the default path to the ghost directory: /var/www/ghost. I had to dig around a little to find it.

    Also, would love to be able to use git to deploy code to this site but this is all pretty new to me. Any tips on setting up git?

    Reply
    • Ok, as it turns out, it’s actually pretty easy. SSH into your ec2 instance and run:
      sudo yum install git

      Then I was able to do:
      sudo git init
      sudo git add .
      sudo git commit -m "initial commit"

      Then follow the standard github instructions for setting up a new repo and pushing from the command line.

      I’m not sure why I have to do sudo every time, so any advice there would be helpful!

      Reply
      • Glad you got it up! Thanks for the tips, ill add the path in there. I believe for git you may always just have to use sudo. Be careful with git tho, dont wanna push an old database file and overwrite your current one.

        Reply
        • Thanks for the tip! Would it make sense to try and use postgres instead of sqlite? Or, would it be safer for me to add the database to the .gitignore?

          Reply
          • If your just using git to just push code to amazon, i believe the ignore would work just fine. Easier to do that than have to install postgres and set that up. I would definitely do some testing first before you wipe out your stuff on accident haha.

            Let us know how it goes!

  6. Hi there!

    So I’ve ssh’d into EC2 and I’ve managed to edit the config.js file, but when I’m in the Ghost editor, the link in the upper-left corner is still listing my-ghost-blog.com. I’ve changed all of the hosts and domains in vim, but it doesn’t seem to be affecting it.

    Now I’m working on figuring out how to configure a DNS for a subdomain (still somewhat of a n00b).

    -A

    Reply
    • You should change that my-ghost-blog.com to your site. It affects when you press on the home page button and the rss feed link. Good luck with the subdomain!!

      Reply
  7. Thanks for the tutorial..

    Had everything running, but then tried to edit the config.js and replaced ALL host: 0.0.0.0 with my amazon address. stopped ghost and attempted to restart, and it’s not coming up again.. also tried restarting the vm.

    ec2-54-234-0-170.compute-1.amazonaws.com

    help please? :)

    Reply
    • Hi Sean. Sounds like there might be something wrong in your config.js file. Can you post the contents of your config.js file and the contents of /var/log/ghost here and then post link and I will take a look.

      Reply
        • Go ahead and just open the file in your editor (vi or pico or whatever) then copy that and paste it into the url (just with your mouse and paste into the browser). I think the problem may be that the url is wrapped with ‘. When doing a url you do not need the ‘ around it, but we would be more than happy to take a look

          Reply
  8. Hey guys, I really appreciate your effort. Especially now that the guide is being updated to point the uninitiated (like me) to the ghost folder.

    Could you enlighten me about how the process for updates will work?

    I’m considering using the EC2 instance to go live with a professional blog project. I would also like some words of advice whether that is wise at this point in time or if I should stick to more mature solutions.

    Reply
    • Glad you brought this up! we are actually currently working on an article on exactly how the updating will work. If your looking to just update ghost you can check this out (http://www.howtoinstallghost.com/how-to-update-ghost/), but we plan on updating the image to make it more secure and a few other things. I will let you know once we publish. Hoping to tonight.

      As for live with a professional blog, the answer is kind of depends haha. A lot of themes are coming out which is very nice. That will help people to adopt it a lot more so they dont have to just use the standard casper theme. Ghost is also coming out with new features very rapidly. For example, Ghost has no analytics plugin. You can still use analytics, but you can’t just click a few buttons and your done. They will in the future right now. Another example, is if you want to have comments on your blog, you need to add them manually but with wordpress, its just there. So if you are willing to either wait for this stuff or add it yourself, you could definitely use Ghost for production. But if your looking for more easy features you might want to look for something that is not so young.

      Hope that helps!! Ghost will definitely be amazing for blogs, and can already do a lot, but its up to you whether your willing to deal with the little quirks while its still being built.

      Reply
      • Thanks for the quick reply.

        To me the most important thing is what happens when things break. Which is why I asked about the update process.

        I assume that there are two update processes for the EC2 instance of ghost really: one for your linux image, and one for the ghost app contained therein. We can update ghost manually, but I guess you are going to also update your image to reflect updates to ghost, at least for larger milestones?

        What I look for in functionality lies more in the way ghost fits into my setup with Amazon Web services and my static sites and their DNS entries. The promised features are just icing on the cake. I was a backer and rather intrigued with the usability originally, just slightly taken aback at the hassle of dealing with node.js setup. Theming is not really an issue for me, I’m very happy with Casper and willing to make some edits myself if need be.

        Quite frankly it was your ready-made instance that made me reconsider ghost for blogging from Amazon. But my lack of understanding of the backup and update processes lead me to think I may be better off trying to get dropplets (https://github.com/circa75/dropplets/) to run. I’m all about the robust backups and accessible backend structure, really. If you can alleviate my concerns there, then I’m probably all in.

        I’m looking forward to your article on updating. If you could shed some light on backups and how to get those backups into a new instance that would be awesome, too.

        Cheers!

        Reply
        • We are going to do the best we can to update the image alongside ghost. It just takes some time to do, but if people use it, we will keep updating it. Backups should be no problem. They have a backup feature built in that you can use. One click and you download a backup of your database (except for images, but im guessing that will change in the future).

          We have also been looking into creating automated backups to dropbox, amazon volumes, etc, but the problem is that for all of these right now you have to stop the Ghost to do the backup. That does not really work cause we can’t have something that just takes down the website every so often. So we are also looking into that, but no timetable.

          Here is the How to Update Ghost AMI article if you wanna check it out.

          Reply
          • Is the code in AMI hosted on GitHub?

            I pushed that code to my repository. If the original code is hosted somewhere and you update it based on the original repo (https://github.com/TryGhost/Ghost), then we can just add your repository as an upstream remote and get the updates without bothering with the AMI.

            Thanks

          • Hey Deniz, the AMI is not hosted in Github. Sorry about that. It is something we are building directly on the image and then pushing out. Just a basic install of Ghost directly from their site. You could definitely use the AMI, install git on there, and then update it yourself for sure. You do not have to update as our AMI updates, you can update however you would like.

  9. Great article – everything worked right down to additional steps.

    I ssh to my ghost, had to chmod the pem (which I had downloaded, emailed and stored on my home Mac)

    Now I am looking at


    Mac-8:Ghost macuser$ ssh -i pemFileName.pem ec2-user@ec2.....amazonaws.com
    Last login: Fri Oct 18 18:53:59 2013 from somewhereIDontRecognize.cox.net.net

    __| __|_ )
    _| ( / Amazon Linux AMI
    ___|\___|___|

    https://aws.amazon.com/amazon-linux-ami/2013.09-release-notes/
    [ec2-user@ip-111.-22-33-44 ~]$ ls
    [ec2-user@ip-111.-22-33-44 ~]$ pwd
    /home/ec2-user
    [ec2-user@ip-111.-22-33-44 ~]$ cd ..
    [ec2-user@ip-111.-22-33-44 home]$ ls
    ec2-user
    [ec2-user@ip-111.-22-33-44 home]$ cd ec2-user/

    so

    1) nothing in that dir – no ghost, no nothing…
    2) should I be worried about “Last access from ….cox.net” ?

    Reply
  10. Hi

    All of the above worked for me except I cannot find /path/to/ghost anywhere

    $ find -type d -name ‘*host*’| head -n1
    gives me nothing

    $ which ghost
    /usr/bin/which: no ghost in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin)

    but I can find npm

    $ which npm
    /usr/local/bin/npm

    Reply
  11. Got ghost going on EC2, did some randomness to get an unused domain pointed at it (lastn.com), now trying to tweak the theme a bit. I can download over SFTP just fine in Cyberduck or Filezilla, but uploading fails with a ‘permission denied’. Any pointers?

    Entirely new to EC2, almost entirely new the SFTP, so if this is mindnumbingly simple, feel free to call me a simpleton… ;)

    Reply
    • Hey Sean. In my experience the easiest way (at least once your comfortable with the command line) is to use the command line tool scp to move files from your local computer to an EC2 instance.

      The basic scp would look like this:

      scp -i /path/to/ssh-key /path/to/file/on-local-computer ec2-user@ec2-domain-name.com:

      There are lots of articles on line if you look up “scp file to ec2 instance”. Here is the Amazon article on how to do it.

      Reply
      • Really? That’s the easiest way to move files? Don’t get me wrong, been messing with computers for, oh, forever, and am pretty comfortable living in terminal when the need arrives. But using the cli to move a bunch of files seems silly when a simple drag-n-drop should be adequate.

        Seems to be a permission problem: the ec2-user just doesn’t have permission to write anything over SFTP, at least for me, and I dunno how to change that. A little chgrp and chmod magic on the themes folder appears to allow me to do what I want.

        Reply
  12. Was able to install and run instance of Ghost.
    Wanted to do “Additional Steps” above.

    In particular, changing config.js.

    I am using WinSCP for this (on Windows). Owner of config.js is “root”, but I am connecting as “ec2-user” (I can not connect to Amazon’s EC2 with ‘root’).

    So I am unable to modify config.js.

    What am I doing wrong?…
    http://ec2-54-200-6-27.us-west-2.compute.amazonaws.com

    Reply
    • Hey John. Once you have SSHed into your ec2 instance you can run sudo vim /var/www/ghost/config.js and you will be able to edit and save the file.

      Let me know how that goes for you.

      Reply
      • Thank you Andy,
        Not very lucky and a bit frustrated -but I guess that is the nature of the Beast.

        vim /var/www/ghost/config.js

        is not letting me do the trick. Again, the file config.js (in fact the whole ghost directory) owner is “root”. vim’s commands (:x or ZZ or :w) are not letting me overcome the permission (644 or rw-r–r–) for the file.

        God, this is painful … vi in 2013.
        Thanks for your help.

        Reply
          • Michel, cool.
            Which user are you using?
            (Itried puTTY, WinSCP –which used puTTY, Cygwin…).
            I can not ssh with other user than “ec2user”. The config.js is already 644, but for user “root”, who is the owner.

            A lot of hassle for getting ghost to work there.

  13. New challenges – assistance needed.
    1) when I restarted ghost after changing config.js as per recommendations, I lost whatever I had written so far. Not a big deal, but perhaps a warning would be in order?
    2) how do I get rid of the developer message on amazon ghost? Can I and should I change environment vars in amazon some where?
    3) I will be the only user/blogger on my blog. Where would I stop other people from signing up on my ghost instance?
    Thanks

    Reply
    • Hey Michel.
      1) When you change the config.js and restart ghost it should not change the database, so normally you should not lose anything. (not saying there isn’t a problem with our ami or ghost possibly, but “normally” it should not affect your posts) How did you stop and start ghost?
      2) Sorry im not sure what you mean. Is this the message you get when sshing into amazon? or is it on the ghost webpage itself?
      3) Right now ghost only supports 1 user. So for now no one can sign up. When they do allow more users, im assuming they will have some way of managing how to allow or disallow people signing up.

      Reply
      • Hi and thanks for your reaction.

        I did exactly what the additional steps above suggested. Used the exact same commands to stop and restart. After I restarted, I saw the default “Welcome to ghost” single blog entry and my cover and logo had been reset to default

        2) I want to add a blog entry, I am not sure where to go so I type /admin and get
        /ghost/signin/ which gives two blue banners. One with a message about email, which I understand and will hopefully handle with the steps mentioned about email and the second bammer is

        Welcome to Ghost. You’re running under the development environment. Your URL is set to http://my-ghost-blog.com. See http://docs.ghost.org for instructions.

        In the docs it says

        “In order to set Ghost to run under a different environment, you need to use an environment variable. … if you normally use forever:
        NODE_ENV=production forever start index.js

        so I will try that…

        Reply
        • hmm, thats weird that it got rid of a post. you could try publishing a new post, and doing it again. see if it wipes it again.

          ah, ya that will work. just means that its is started under the development configs. the NODE_ENV=production will start it with the production configs, so that should go away.

          Reply
  14. Not able to modify config.js:


    [ec2-user@ip-172-31-2-201 ghost]$ vim config.js
    [ec2-user@ip-172-31-2-201 ghost]$ chmod 664 config.js
    chmod: changing permissions of `config.js': Operation not permitted
    [ec2-user@ip-172-31-2-201 ghost]$ cp config.js config1.js
    cp: cannot create regular file `config1.js': Permission denied
    [ec2-user@ip-172-31-2-201 ghost]$ ls -l
    total 76
    -rw-r--r-- 1 root root 2672 Oct 18 12:47 CHANGELOG.md
    -rw-r--r-- 1 root root 2845 Oct 18 12:47 config.example.js
    -rw-r--r-- 1 root root 2831 Oct 18 18:23 config.js
    drwxr-xr-x 6 root root 4096 Oct 18 18:21 content
    drwxr-xr-x 6 root root 4096 Oct 18 18:21 core
    -rw-r--r-- 1 root root 32289 Oct 18 12:47 Gruntfile.js
    -rw-r--r-- 1 root root 461 Oct 18 12:47 index.js
    -rw-r--r-- 1 root root 1093 Oct 18 12:47 LICENSE.txt
    drwxr-xr-x 44 ec2-user ec2-user 4096 Oct 18 18:21 node_modules
    -rw-r--r-- 1 root root 1688 Oct 18 12:47 package.json
    -rw-r--r-- 1 root root 4990 Oct 18 12:47 README.md
    [ec2-user@ip-172-31-2-201 ghost]$ cdmod 644 config.js
    -bash: cdmod: command not found
    [ec2-user@ip-172-31-2-201 ghost]$ chmod 644 config.js
    chmod: changing permissions of `config.js': Operation not permitted
    [ec2-user@ip-172-31-2-201 ghost]$

    Any further help?

    Reply
    • Ya, if you go to the company that you own the domain with, you can ask them to setup a record that will forward all your traffic to yourdomain.com to your amazon ec2 domain. You can ask them to do a “Framed” forwarding, so the url will stay as yourdomain.com as people browse even though they are actually on your amazon site. No changes need to be made to your amazon instance, this is all done through the company that hosts your domain.

      Does that all make sense?

      Reply
      • Does “Framed” actually mean they will wrap in frames? If so, I can do that myself. I want to have
        mydomain.com/blog/my+latest+blogpost

        to show the content of

        ec2…….amazonaws.com/ghost/my+latest+blogpost

        Reply
        • Ya i believe frames will do that for you. You can just point your domain at the main amazon page, and it should work for all the sub-categories after that.

          Reply
  15. I setup an instance on Amazon’s EC2 and used Route 53 in order to use the domain I purchased from Dreamhost.

    Now the issue, when I try to login to mypersonaldomain.com/ghost/signup it says there is already a registered user on this account and that only one is allowed for now. I haven’t set one up on this specific instance and have no idea to either A) find out which email address registered or B) how to reset this email address.

    Anyone have any ideas? If this isn’t the right forum them I apologize. Thanks!

    Reply
    • Hey Patrick. Do you have content in Ghost that you want to save? If not you can stop Ghost, delete the database, and start Ghost and it will create a new default database. The database file is located in /path/to/ghost/content/data/.

      Hope that helps!

      Reply
      • Andy – Nope, no content worth saving!

        I stopped Ghost and tried deleting both ghost.db and ghost-dev.db but was greeted a ‘permission denied’ when I tried to execute.

        I forever started Ghost back up, but now my URL won’t load…Quick glance at config.js appears to be untouched.

        Reply
        • Also seeing

          “ERROR: Cannot find the configuration for the current NODE_ENV”
          NODE_ENV=development

          When I attempted to run npm start.

          Reply
          • Andy –
            I believe I was looking TOO far into everything. I started a new instance, repeated the necessary steps and boom, website up and running without any hurdles (yet). Thanks for the help.

  16. Just got a bill from AWS.
    Would it be possible to mention in your howto’s which service is free and which is not?
    Are ANY of them free?
    Thanks

    Reply
      • Thanks, that does not quite explain the

        Amazon Elastic Compute Cloud $6.46
        Charges $5.34
        VAT ** $1.12

        for basically doing nothing but
        1) install ghost
        2) install SES
        3) write two blog entries only viewed by me.

        The breakdown CSV does not help me much.

        Service, Operation, UsageType, Resource, StartTime, EndTime, UsageValue
        AmazonEC2,EBS:IO-Write,USW2-EBS:VolumeIOUsage,,11/01/13 00:00:00,12/01/13 00:00:00,4165
        AmazonEC2,EBS:IO-Read,USW2-EBS:VolumeIOUsage,,11/01/13 00:00:00,12/01/13 00:00:00,12
        AmazonEC2,RunInstances,USW2-BoxUsage:t1.micro,,11/01/13 00:00:00,12/01/13 00:00:00,67
        AmazonEC2,CreateVolume,USW2-EBS:VolumeUsage,,11/01/13 00:00:00,12/01/13 00:00:00,575525617664
        AmazonEC2,RunInstances,USW2-DataTransfer-In-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,1003970
        AmazonEC2,RunInstances,USW2-DataTransfer-Out-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,4038312
        AmazonEC2,RunInstances,USW2-C3DataTransfer-In-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,20647
        AmazonEC2,RunInstances,USW2-C3DataTransfer-Out-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,3561
        AmazonEC2,PublicIP-In,USW2-DataTransfer-Regional-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,60
        AmazonEC2,PublicIP-In,USW2-APN1-AWS-In-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,44
        AmazonEC2,PublicIP-In,USW2-EU-AWS-In-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,339
        AmazonEC2,PublicIP-Out,USW2-EU-AWS-Out-Bytes,,11/01/13 00:00:00,12/01/13 00:00:00,618

        Reply
        • are you running a micro instance? it sounds like you are not, so you are getting charged a certain amount per hour. I would stop the instance until you figure out why so you dont keep getting charged. Double check with them also to make sure that it does not happen again.

          Reply
          • Yes I am seemingly running a micro instance I now stopped. I do wish I knew what I was doing here. Quite opaque without the deeper knowledge of what AWS is actually doing after my point and click exercise. As the Dutch say: Goedkoop is duurkoop. (If you buy cheaply you pay dearly).

  17. Hey All,

    Just installed on your image at amazon, made the configs, and changed a few settings, as naming the blog something else than Ghost, and uploaded a logo.

    After, I made the changes at config.js and restarted ghost on command line. So All changes I made got lost… The site got renamed to Ghost, and I loosed my logo.

    Everytime that I restart it, it’ll loose everything? Is that correct? How do I persist those data? Is there any config to use a MySql database that I can store on other server and have the data persisted?

    Thanks!

    RA

    Reply
  18. Hello, used this and working well, however wanted add new templates. Am able to connect using filezilla, however not able to write any files to theme folder. Cannot seem to find out how to get permission working to do this. Thanks, J

    Reply
    • wanted to add… Connecting using filezilla on mac using sftp as normal login user: ec2-user. I am new to amazon ec2 services, setup free account today and not a developer. Am able to use the default theme fine to access, add blog posts.

      Reply
      • I think the best way to do it would be to just use the scp command instead of filezilla. so on your computer do something like this:

        scp /path/to/theme.zip ec2-user@amazon_address.com:/.
        then ssh into your amazon instance, and move and unzip that file into the theme directory. I think that should work for you.

        Reply
        • Thanks David,

          I’m a beginner at using the mac terminal and amazon ec2. What would I have to do in order first login to the server from the terminal in order to transfer files. Also do I have to do something with the .pem file first? If you can please give me a brief step by step (if its basic) I would really appreciate it. Also how would I unzip a file inside of the instance. I’ve tried to “connect to your instance” inside of the amazon interface however have not been able to get anywhere.

          Thanks again, Jordan

          Reply
        • David, I was able to ssh -i into amazon through the terminal but have been unable to copy the entire folder and its contents. I get permission denied (public key) message.

          I tried using scp -r /path of folder ec2-user@amazon_address.com:/.

          Reply
          • my bad, forgot to add the .pem. do scp -i /path/to/amazon.pem /path/to/ghost.zip ec2-user@amazon_address.com:~/.

          • Hey David,

            At the end of the day and lots of frustrating hours later. I was able to do the following in the terminal which allowed me to use filezilla to write and add new templates. Not sure if this is a correct or good method but it worked.

            sudo -s
            chmod 777 /directory/sub-directories

  19. I have everything working, install went smoothly, yet when I SSH into the instance I see no files…and nothing resembling the ghost install.

    Anyone have any ideas?

    Reply
    • Hey Kerry. Glad to hear you have Ghost up and running!

      On our Amazon AMI, Ghost can be found in the /var/www/ghost directory. So once you SSH into your EC2 instance just cd to /var/www/ghost/ and you will see all of the Ghost files.

      Reply
  20. Pingback: How To Update Ghost To Version 0.4

  21. I’ve followed the 14 steps and I have a blog that’s running via Amazon EC2 Public DNS address. Now… How do I edit its contents? I’m a newb and have a Windows 7 laptop. (Please don’t judge.)

    Reply
    • Hi AJ. By “edit the contents” do you mean get logged into Ghost and start creating posts?

      If so the Ghost interface can be found by added /ghost to the end of your Amazon Public DNS address.

      Let me know if that is not what you are looking for and welcome to the Ghost community! :)

      Reply
      • Wow. It’s that easy?! O.O Thanks Andy!
        Yep… definitely dropping my blogger and WordPress accounts. (Again, don’t judge pls.)

        Reply
        • No problem AJ…happy to help. I don’t blame you for dropping your blogger or WordPress accounts…Ghost is Amazing. :)

          If you do have more questions about the Amazon AMI feel free to comment here or if you have general Ghost questions you can ask in our Ghost Q&A site.

          Happy Ghosting!

          Reply
  22. I followed the steps on this tutorial and everything seems to be working fine except for the fact that I can’t restart ghost. It says that the forever command is not found.

    On a side note, I am also concerned with AWS randomly charging me a bunch of money for a stupid reason. Any tips on how to avoid this?

    Reply
    • Hey, for the forever command, Amazon just updated our image to Ghost 0.4 but did not update the description yet. We switched from using Forever to using PM2. I also changed the article just now. To restart ghost use this command:

      sudo pm2 restart all

      Reply
      • Hi, I’m having the same problem, neither pm2 or forever commands are working for restart all. I’ve only just installed today if that helps?

        Reply
        • Hi James. To restart Ghost run:

          pm2 restart all

          If you run the above command with sudo it will complain about the command not being found. We forgot to add pm2 into the root users path. If you would like to be able to restart Ghost from the root user you can add pm2 to the root users path with:

          sudo ln -s /usr/local/bin/pm2 /usr/bin/pm2

          Reply
          • Thanks Andy, worked like a charm. And thanks for to both of you for all your work on this How-to. Really useful!

          • Actually, according to the console, the restart went well. However, when I visit the blog online, it doesn’t respond/load. The circle on the Chrome tab just keeps spinning with no response, even after a couple minutes. This wasn’t happening before the restart. Any ideas of what could have happened?

          • Lets take a look at the pm2 error file and see if it can shed any light on this….run this:

            sudo cat /root/.pm2/logs/ghost-err-0.log

            Let us know if there is anything that might be of interest.

          • I managed to get it working by returning the production host to ’0.0.0.0′ rather than the ‘url_amazon_gave_you.com’ that I had changed it to. I saw on earlier comments that other people had issues with this but I wasn’t able to find a solution. Should I just leave it at ’0.0.0.0′?

          • Thanks for pointing me towards the logs. It seems like something is wrong with my config.js file. I got a few things like

            ERROR: Cannot find the configuration for the current NODE_ENV
            NODE_ENV=production
            Ensure your config.js has a section for the current NODE_ENV value andis formatted properly.

            Error: Cannot find the configuartion for the current NODE_ENV at…

            and then I got a bunch of:

            Error: getaddrinfo ENOTFOUND
            at errnoException (dns.js:37:11)
            at Object.onanswer [as oncomplete] (dns.js:124:16)Error: getaddrinfo ENOTFOUND

  23. Hi guys. Great guide – has worked very well for me so far. I’ve got into my config.js file, and changed all of the 0.0.0.0′s to the amazon URL. However, I can’t seem to restart ghost. I have tried the solution above without the sudo, but the console just doesn’t seem to respond to the command. Am I typing it into the wrong place? at the bottom of the config.js file?

    sorry I’m very new to this!

    Reply
  24. So what does the “If you want to do some additional steps for added security” steps above do as far as security goes? Also, not sure if this is only me, but “sudo pm2 restart all” didn’t work for me and was giving me an error that pm2 is a command not found. Hence, I ended up using ‘sudo forever restartall.’

    Reply
  25. Hi, I am not able to understand whats the difference between this above mentioned method and the one which uses Bitnami. Please highlight.

    Reply
  26. Excellent article. I was able to deploy a blog very fast.

    I did however have 1 issue. Towards the end you mention to change

    host: ’0.0.0.0′, to the url from Amazon. But that caused problems for me. It was working just fine as it was before that change. The page would not load after that change. I switched back to the host: ’0.0.0.0′, and everything was fine again.

    My blog works!

    what was the point of changing that host? not sure what I am missing here. thanks.

    Reply
    • Too bad it did not end up being free. Had to pay 7USD or something for the privilege of running their engine.

      Switched to Kite, which then also started charging. I cannot run ghost on a normal Godaddy account only on a VPS, so I have given up completely on Ghost :(

      Reply
      • Were you running on a micro instance? If you are a new customer, you get a micro instance for free for a year. We have a few hundred people using our ami, and I haven’t heard of others getting charged. Check your instance type and see. If you were using micro, email amazon and ask why you were changed.

        Reply
        • I had an old amazon dev account.
          I gave up and alas don’t have any apps at amazon anymore. I wanted ghost for free because I was not sure if blogging was for me.

          Reply
          • They give you pre-loaded themes, so you can’t upload your own. And you have to post once a week, or else they shut the blog down. Fine for checking out Ghost and deciding if you want to use it, but not really a suitable option for a long term blog.

  27. Hi,

    A very newby question: when trying to get ghost on amazon for FREE for the first year, it there is one screen at the beginning, which says there 14.40$ of fees. Do not understand it’s free or there are supplimentary fees?

    Thanks

    Reply
    • I could not get it for free. I already had an Amazon account and when I started using Ghost, I was charged 5$ while just testing it out. Disclaimer: I was clueless about what they charged me for, so I might have clicked the wrong button

      Reply
    • Hey Corey, are you talking about just having an outbound link to a different site inside of a post? If so, you can add in a link by typing this into your post:

      Title

      Title is what you want the link to say, and URL is where you want the link to take them. Hope that answers your question! If you were talking about something else, let me know.

      Reply
  28. I get a ’502 Bad Gateway nginx/1.4.7′ when loading the instance’s public DNS address.

    This is immediately after deploying it. I have yet to SSH into it. Anything in particular I need to do to fix this.

    Reply
    • Hi Kriss. Ghost is being run by PM2 inside of the Ghost user. So you can SSH into the EC2 instance with the ec2-user, then run sudo -s to promote yourself to root. Next you will need to change over to the Ghost user with su - ghost, and then you can run pm2 restart ghost.

      Alternatively if you don’t mind the downtime and you dont wan tto run the above commands you can restart your EC2 instance.

      Reply
  29. Is there any posts that will help me understand how I can set up a way to post updates to my ec2 instance using git ?

    I’d really like to host the blog locally and make changes and then push that up to the EC2 instance.

    Reply

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>