The original link: www.jianshu.com/p/527583637…

Those of you who just bought a new server, or have unused server resources, or really want to start your own blog are blessed. It’s a wonderful thing to write down what you think and feel once in a while and then read it again after a while. Here I will introduce my own way to build a blog.

This tutorial in line with no programming experience of friends to build their own blog to provide a simple solution, if there is any problem can directly comment or contact me for advice.

No server yet? Fast into a 2019 Ali Cloud double 11 bottom price server!

To view more

Display effect:

The blog home page

The background page

Some of the main tools used in this time:

  1. Docker
  2. Ghost

Start building:

  1. Install Docker CentOS Windows Mac

  2. Install blog mkdir -p/data/blog docker run – restart always – d – name blog – v/data/blog: / var/lib/ghost/content – p 2368:2368 Ghost :alpine Ghost :alpine docker run: docker run: docker run: ghost:alpine -d: Run your application in the background –name blog Give your application a name, Blogs can be replaced by any English letters – v/data/blog: / var/lib/ghost/content said a directory on your local on the program with inside, note: This directory is the blog content folder in the container, so that when you delete the container, the content you wrote will be retained, so that the next time you press this command you will not lose your previous content. -p 2368:2368 maps a port in the container to your host (that is, the server you are operating on) Ghost :alpine image name

  3. Type http://127.0.0.1:2368 into your browser and you will see an effect similar to the blog’s home page mentioned above.

  4. Your blog is built, so how do you add content and other operations?

  5. Type http://127.0.0.1:2368/admin in your browser will enter the installation of the blog:

  6. Configure your blog

  7. Here you blog all Settings are completed, you can see the effect of the display of the background page effect, is not very simple ~

  8. You can click on navigation on the left, play around, and focus on creating new articles. You can click on the left side of the New Story, you can see the effect of the display of the effect of writing an article, you can be happy to write, after writing, click publish directly on the home page display.

Blog online

  1. Of course, you can’t give other people access to the Internet after you configure it locally, so you need to have a domain name. Resolve your domain name to your online server.
  2. Execute the following command (the only difference is that port 2368 has been changed to 80)mkdir -p /data/blog docker run --restart always -d --name blog -v /data/blog:/var/lib/ghost/content -p 80:2368 ghost:alpine
  3. Visit your domain name and start setting up and go down

Senior play

In the previous step, you have acquired a new personal blog. The rest can optimize their own theme, modify the basic configuration of the blog, modify the site navigation and some additional configuration, you can explore. The theme can be modified, and there is time to write another article to introduce this.

conclusion

This tutorial is very basic and suitable for those who know a little or nothing. This blog is still very powerful, technical level of friends can completely customize, write their own theme, playability is very strong. Finally, I wish you a happy blog, if you have any questions, you can contact me through the above micro blog.