[Tutorial] Step by Step Primer to setup ERPNext on Google Cloud Platform

Thank you BKM surely you did all the work - glad to hear you met with success and thanks especially for detailing your learnings for all

Hi @bkm Sorry for my late reply. I am glad you have figured out a new way. I never tried your steps before, from the beginning, I used Snapshot for regular backup or clone with it. You can find ā€œSnapshotā€ next to ā€œCustom Imageā€. Before using snapshot, you need to create one first on Snapshot tab on left side. (see attachment)

After you create an image, can you share it with others so that people can have fresh ERPNext in second by uploading it with GCP? :smiley: Thanks.

BTW, I saw your post in the thread. Do you encounter upgrade issue with fresh ERPNext installation (not Bitnami version)?

Wellā€¦ I have not figured out how to take the image away from GCP, and I am not sure that you can. According to the documentation, custom images cannot be shared outside the project they where they were created. As much as I would like to make a publicly sharable image, I do not think GCP allows for that function.

You can import external images to GCP, but I have yet to find a way to EXPORT them back to your local system. We would need to be able to do that before we could then share it out publicly.

BKM

I do not attempt upgrades once I have a system running. In the past this was because I had no way to recover my system if the upgrade failed. I had tried it several times and used many different advice from the forum each time to attempt upgrades, but none of them ever worked. I always had to strip the server and start over again. That was a real headache and very wasteful of my time.

However, that was all during the transition from version7 to version 8, and again from version 8.0.x to 8.1 or 8.2. The Developers may have addressed the update failures by now, but my reading of the recent posts indicates there are still issues. Now that we have the instructions in this thread we may be able to try things we would have avoided in the past.

The good news is that if you want to try an update, you can make a custom image of your VM instance then try the update. If the update works then you make another fresh custom image so you can get back to that update state if something goes wrong later. If the update fails or corrupts your system, just delete the VM instance and restart custom image made prior to update in a new instance until the update function works better.

BKM

Thanks @bkm Look forward to your 1st video cast :wink:

ā€œI have yet to find a way to EXPORT them back to your local systemā€

Fortunately it seems doable BKM - these pages explain how to download to your local an ā€˜objectā€™ from a Google Cloud Storage ā€˜bucketā€™:

Some restrictions apply for eg. only Chrome browser support, no Windows images

As well you may need command line access!? This page states ā€˜The Cloud Platform Console enables you to perform basic storage management tasks with your data using a browserā€™

You are now the resident expertā€¦

Hi @bkm I can set up a new ERPNext on GCP with your tutorial in no time now. Thank you so much.

Well, I have put in some time with researching the ā€œSnapshotā€ function and it has its drawbacks. The documents that @clarkej pointed to actually use the snapshot function as part of the steps to make an exportable image.

Unfortunately, the snapshot function requires that you separate how you store information from your application so that you can have the most optimized snapshot image. It will take a great deal more reading and experimenting to actually make that work. You see, the snapshot is just that, a snapshot of the entire disk image including the cache, buffers, and swap data all of which is really unwanted in a clean image.

I donā€™t know. Maybe itā€™s worth the extra wasted space and the excess waste every time you do an incremental snapshot just to make it easier to manage. It becomes a matter of weighing the cost of the extra storage over the long term against the up-front work required to make everything operate in a more efficient way in the first place.

I will have to think about this one. I am pretty sure I will try it at least once just to see if I can port the custom image to another platform. Maybe the result of that test will determine just how much effort I want to put into the rest of the portability scenario. It really is a much bigger effort than the other two I detailed here and would not be for the novice unless I can find the shortcuts to make it easier to manage.

Anyway, that will have to be for another day. I am fairly behind right now in my deliverables and will come back to this in another 2 or 3 weeks. Thanks @Robert1112 for the pointer to snapshots and thanks @clarkej for the documentation pointer for making the image exportable.

BKM

2 Likes

Thanks for your very thorough work ! Iā€™ve a question however, did you change anything in GPC configuration to get mail working ? I know you need to allow access for less secure application, but excluding that, does it work with just your step by step primer conf ?
Thanks !
Mel

Ahhā€¦ what a timely question! I have NOT tried using the email functions in ERPNext up to this point. However, I do need to get it working in the next few days.

So, the current answer to your question is: ā€œI really do not knowā€

This process I outlined is very easy to use and further down the same thread I also outline how to create a Virtual Disk Image that contains all of your data and configuration settings that you can spin up any time you feel the need to start over again fresh. This should allow you the flexibility to try many different things on any populated instance with the assurance that you can always get back to a starting point that is NOT a complete rebuild.

If you find in your work that the steps I outlined work for using the email functions, then please report back here for others to also know. If you find there are steps needed to be changed in order to get the mail working, then also report that here. Everyone will benefit.

In fact, if you find there needs to be changes, let me know and I will edit the fist post to include your changes and happily note your contribution to the original work right next to the new information.

BKM

Hi BKM,

thatā€™ll be my pleasure, but Iā€™m afraid Iā€™m currently completly stuck.
Iā€™m swimming in the proverbial GPC doc pool. If I donā€™t drown there, I promise Iā€™ll come back here to report.
Iā€™ll follow your advice about Virtual Disk Image, it makes sense, and if necessary Iā€™ll be able to vent my anger by disintagrating the disobligeant image.
Thanks for the quick answer !

Edit: I think we nailed it. Using your setup, we got it to work rather smoothly. Our sysadmin created a gmail smtp-relay and opened output ports. I asked him to write down the steps to post here.

Hi @MelBohard, I am also using GCP and would love it if you could share these instructions.

That is Great News! We are looking forward to your post with those instruction steps.:star_struck:

BTWā€¦ Look for an update to the original post on this thread sometime in the next several days. I am hoping to make it a little easier and better for upgrading later.

BKM

Thank you for this! Really!
How do I apply updates to the bench though?

Unfortunately, I was still learning when I wrote this. The steps I outlined above will give you a running system, but a mistake in the steps prevents the system from being updated. I tried to go back and fix it but we are not able to edit a post after it is about 30 days old.

If you use the above steps, just change the install command to the following:

sudo python install.py --production --user username

Just replace ā€œusernameā€ with the username of your Debian install. When you are using the command line, the user name is that part of the prompt before the ā€œ@ā€ sign. If you use the --user switch in the install command, then you will be able to update the bench later if you ever need to.

If you do not use the --user switch, then the programs are installed by default into a user called ā€œfrappeā€ which has no login credentials and therefore you cannot ever update the bench.

Hope this helps. If you have already made a server you can always delete it and build one up again in just a few minutes using the correct install command.

BKM

1 Like

In Ubuntu as long as you are logged in with an account that has sudo rights, you can do the following to update

  1. sudo su frappe
  2. cd /home/frappe/frappe-bench
  3. bench update

and it will work fine.

If for some reason, you want to change the frappe user password, just go

  1. sudo passwd frappe

Is this not the case for Debian?

@felix

When using the Google Cloud Platform, I was not able to create credentials for the frappe user in Debian 8. I have not tried Ubuntu because I never liked the user interface of it.

The Google Cloud Platform is just a place to experiment. You can quickly setup and delete servers there, or clone them for other testing purposes. I was most familiar with Debian, so that is what I used. In order to write a ā€œstep by stepā€ guide, I had to work in familiar surroundings and Debian was the obvious choice.

Users that follow the steps will be able to really exercise he ERPNext system without having to stress over how to install it. If they are happy with it, they can even keep it on GCP and just pay for a permanent ip address. Sometime ago when I started out with ERPNext, the foundations cloud services were very reasonable. Now I believe they are quite over priced for the level of uncertainty you are forced to contend with on a weekly basis. If you use the ERPNExt cloud services for your production environment, you will be constantly having to learn what changed each week as the new versions are updated into the system. Anyone actually trying to use the system in production cannot possibly put up with that level of uncertainty. They will want to know the system works exactly the same today as it did yesterday and last week or last month. The rapidly changing versions just does not fit into a stable working environment.

Anyway, as it stands now, I will have to try to get it to work on CentOS 6 because that seems to be the only OS many of the service providers are offering in their VPS packages. CentOS 6 is itā€™s own set of problems because it is so old.

BKM

As a newbie (in programming, in ERP, and in business) who wants to try ERPnext, this really helps in understanding how the server setup works.

I think the text instructions are sufficient and clear enough (for readers: reading the whole text and outlining the actual steps helps). In addition, its free and easy to start over again. The $300 credit works for google accounts outside US, Iā€™m in the Philippines.

Got a debian8 VM instance with ERPnext v10 which should last free for ~7months. I just want to use this window time to train the company Iā€™m working with to help them deploy an ERP (we are currently using spreadsheets).

A bit off-topic, but so far, the real challenge isnā€™t the setup, nor the UI, but the actual mapping of business process itself and putting it into the ERP.

That is Correct!! Figuring out how to integrate the ERPNext system into an existing set of business processes is the biggest challenge for any implementation. The good thing is that when you run across a unique business process that doesnā€™t exactly fit in the system, you can hire a developer to make custom apps in order to build the unique process into ERPNext. Just try doing that with SAP or NaVision.

BKM

2 Likes

@bkm, have you tried installing ERPNext on a GCP Container Enginer?

I intend to use the system to provide some online sales tools and I am researching the implementation alternatives within GCP (Compute, App Engine, Container, etc). Of these, I understand that it is not possible to implement in App Engine (PaaS), which is a shame because it would be much easier to gain scalability.