Word of caution at the beginning here. What follows here is very simplified and long winded, but worth it if you are struggling with setting up and ERPNext test system.
It is not an easy task to create an environment for testing ERPNext and I know I have stumbled many times along the way. To be sure, I am nowhere near understand all of the complexities of the system and just getting a running system was a huge hurdle for me. Now that I have become somewhat practiced in building, tearing down, and building ERPNext from the ground up after many botched starts, I have learned a few things I thought I would pass on to others trying to find a foot hold in their climb to the top of the ERPNext heap.
NOTICE
This is where I tell you what this post is about and what it is “not” about and what to expect.
- I am not financially tied to Google or ERPNext developers except that I gladly pay either for their services.
- I am NOT a developer, I am an implementer trying to figure this all out (just like you).
- This is just the easiest method I could find to get a running system to evaluate.
- There may be better ways to do this, but I know this way works, I have done it a lot.
- This is based on my personal experience (not forum advice or failed google searches).
- References to free trials at Google are apparently only available to USA accounts but everything still works the same around the world (just maybe not the free trials).
Okay, now that that is out of the way, let me tell you how I came to this solution. I have tried using the VM image downloaded from the ERPnext repository and found it to be old version and difficult to get it to upgrade to the latest. I also tried using the “ready-made” ERPnext image from the Bitmani group and although it was a very recent version, it far too many functional problems and little in the way of support. I had previously made a local plain Debian 8 server and loaded the ERPNext system on it just to have something working experiment on. Then I stumbled across something in the Google Cloud Services documentation that just turned on that idea light above myhead.
Google Cloud Services has a list of “Virtual Machines” that you can simple click on and start up in your account. In that list of VM images is a whole section of just bare operating systems and you can start them or kill them off with the click of a mouse and no installation headaches! See link:
In my case, I had been working with Debian 8 on my local server box and I had stripped it and reloaded it by hand countless times to keep trying ERPNext. Now I could just spin up a fresh server in less than a minute, configure it or install anything on it I wanted and even save it for reuse. Wow, what a deal.
To make it even better, if you create a Google Cloud Services account (at least here in the USA) they give you $300 of free credit for you to test drive the cloud services. That means you can make and break your installation for quite a long time in testing mode and start over as many times as you need. In my case I think using the service calculator online it looks like my ERPNext sandbox will be free for about 7 or 8 months. (Your mileage may vary)
Here is the link to signing up with the Google Cloud:
Go to the link and click on “More Options” to see the “Create Account” option. All you really need is a Gmail account and you must be willing to give them credit card information. They never charge your card and promised to simply suspend your account if you run out of free trial credit. Then you’re supposed to log in and upgrade to paying for it if you still want to keep the account. (The above link may not work outside the US so please just look for the “Try It Free” link on the Google Cloud Services page)
If you want to see what it would cost to run a VM instance on Google Cloud Services, then try using this link to the online “compute engine” pricing tool:
If you go to the calculator and fill in the items there, it will give you an estimate of how much it would cost each month to keep it running. This is where you can see just how long your free trial credit will last.
Ok, so everything up to this point has been to show you how to evaluate your choice of using the Google Cloud Platform to run ERPNext. If you want to go any further you will need to have an account there and be ready to get started. So here we go…
Log into your Google Cloud account and click on the “CONSOLE” link or button in the upper right side of the screen next to your login ID. This will bring you to where everything can be started.
On the left hand side of the screen, scroll down and click on the “Compute Engine” link under the COMPUTE heading. This will take you to another screen level that lists all the things you can do with your Google Cloud virtual computer.
Look for the link listed on the left side again for “Images” and click on it. You will be presented with a long list of “ready-to-launch” operating system images. Scroll down the list and find the Debian images. At the time of this writing there was a version 8 and a version 9 image to choose from. Since I had experimented with version 8 on a local server, I chose that one for my test run.
Be Aware… if you select a Red Hat, Suse, or Microsoft OS image, you will have to pay a premium for it and it is not covered in your free trial credit. So using the Debian images made good financial sense because they are GPL licensed and free to use.
So, if you click on one of the Debian VM image links, you are taken to a screen listing the details of the image, when it was published, and the license details. At the top of that screen there is a “Create Instance” link. Clicking on this will start up a VM Debian operating system right before your eyes. When it is up and running (it takes a few minutes) you will be taken to the “VM Instances” screen where you will see your fresh OS instance listed.
The listing will include the name of your new Debian OS instance, the zone you chose to run your computing environment, an internal IP address, an external IP address, and a connection link. The connection link is how you access your new Debian VM server.
The connection link usually is listed as SSH. Next to it there is a drop-down arrow. Click on the drop-down arrow and select “Open in Browser Window” (Note: you will need to make sure any pop-up blocking is disabled on your browser so it can pop up the console window).
The window that pops up is the command line console for your new server. You will only have to do 2 things here to get your ERPNext server up and running. Don’t be afraid. It really is pretty simple. It’s just typing in the 2 commands. (If you’re really good with keyboard shortcuts you could probably copy the commands from here and paste them on the command line by using the CTRL-V key combination).
Here is the first command, just type or copy it to the command prompt and hit the enter key:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
(Sorry, but the forum wants to make it stupid link. I cant get it to be just text so just type it in and include the wget at the beginning)
This is the command to use at the time of this writing. To be sure though you can copy whatever the current valid command is from the GitHub location at the link below. Just scroll down until you see the heading that says “Easy Install” and the command will be there as the first step for linux users. Here is the link to the GitHub instructions:
Anyway, once you have entered the correct command and hit enter, it takes about 10 seconds or less to copy the install script to your new server. When it finishes, it goes back to a blinking command prompt and you are ready for the next command. So here it is:
sudo python install.py --production
Type in the above command exactly as it appears and hit enter. In case you were wondering, there are 2 dashes before the word production in that command. Sometimes they run together and look like one. Just be sure to use 2. Also if you are unsure and want to see the most current command they recommend to use you will also find it at the same github link above just a little further down the page.
Once you have started the install script, you will see many lines of text fly up the screen as it works to gather all the important stuff to make ERPNext work. Do not fear this. It is normal and it is a good sign that everything is working. However you cannot just walk away from this. After only a minute or 2 or 3, the lines of text will stop. The line at the bottom will be asking for you to enter an administrator password for the database engine. Choose a secure password, type it in, and press enter. You will be asked to verify the same password by typing it again. Please type carefully as the command line hides what you type as a measure of security.
Once you have typed in the database engine password, you will immediately be prompted to choose a secure password for the Administrator account in ERPNext. Again, please type carefully and remember this one as you will need it to log into ERPNext the first time. Remember to also type the same thing to verify this entry just like the previous password.
Once the passwords are entered, the screen will resume streaming lines of text again as it works to complete the setup of your ERPNext system. This process may take another 2 or 3 minutes. Even if it looks like it stopped for a while, don’t interrupt it. It frequently looks like it has paused, but that is just the installer churning through a lot of steps in the background. When the system is finished installing, it will present you with the same blinking command prompt you started with at the very beginning. If you are unsure, you can tap the enter key. If the command prompt advanced a line then you are finished.
Once finished, type the word exit at the command prompt and hit enter. The black console window will disappear and you will be back at your VM Instances screen. At this point your ERPNext sysem is installed and “almost” ready to run. You still have one more important thing to do in order to access your new ERPNext cloud server. So, again, here we go…
Click on the name of your Debain VM Instance on the VM Instance screen. You will be taken to the VM Instance Details screen for your new server. Across the top of the screen are a few links you need to know about. They are Edit, Reset, Clone, Stop, and Delete. You can use some of them to control your running server instance. More on them later.
Right now you need to click on the EDIT link so we can turn on access to your server for the outside world. After you click edit, you will be permitted to alter some of the things that control your server. Right now we are only interested in the items listed under the heading of “Firewalls”.
Under Firewalls heading, click on the boxes next to “Allow HTTP traffic” and “Allow HTTPS traffic” this should put check marks next to them to enable these settings. Scroll to the bottom of the screen and click “Save”. It may take a minute to go out to your server and make those changes. When it finishes, click on the “VM Instances” link on the left column of the screen again to go back to your VM Instances list.
Your ERPNext cloud server is now ready to use. However, we need to talk a bit bout some of the other options you saw across the top of your previous screen. So here is the details:
Edit – of course let you edit the details
Reset – will reset the server and restart everything in the event you got it locked up by accident
Clone – this is supposed to allow you to make copies of your running server and add them to your list of VM instances that you can run when you want. HOWEVER… This feature doe NOT work for ERPNext servers we create here. Believe me, I tried. They clone and they appear to start up but no matter what I tried the clones could not be accessed. So, this may be useful for other types of servers you play with in the future, but know that this ERPNExt server you just created will not clone properly. But so what!?! You now have a cool ERPNext cloud server and it didn’t take much effort. So if you need more VM servers, just run through it again.
Stop – This allows you to stop your server and put it to rest in the event you want to spin up a different server on the list you will eventually create of test servers. Once you use the Stop command, it changes to a Start command at the top of the screen in case you want to restart it now or at a later time. If you are not going to use the server for a while, you can stop it. That will suspend the hourly charge for running it and make your free trial credit last a bit longer. If you are outside the US and are paying for all of this, it just saves you money.
Delete – This option is there to allow you to delete VM server instances you may have created and no longer need, or you accidently corrupted. It removes it from your list permanently.
Okay, I know. You are tired of reading and you just want to start up your server online and see the ERPNext login screen. Well, there are still a few things you need to know before you jump in the deep end of the pool. So get yourself back to the VM Instances screen where you can see your server in the list.
Under the External IP Address column you will see the actual IP address that you could type into a browser and jump right to your new ERPNext cloud server. However, this address can change on you so you really need to understand how this works.
The external IP address listed is call an ephemeral address. Is it only valid as long as your particular VM instance is actually running. If you need to stop your server for any reason and restart it, THIS ADDRESS WILL CHANGE!!!
If you want to get a permanent IP address for your server, you can by looking for the link on the details page to “promote” your address to permanent. This will cost quite a bit extra. If you are only testing the system and using this as a sandbox, then it is not worth the extra cost to get a permanent IP address. So, you just need to be aware that anything that interrupts the normal operation of your VM server will also likely result in being assigned a new external IP address.
If you ever experience a time that you cannot get to your server, just log back into the Google Cloud Platform account and check the VM Instances list to see the new address.
Okay, enough already, let’s go try out your fresh ERPNext cloud server. So, write down the external IP address. You will need it to get to your server. (Note: don’t try to click on the IP address there on the VM Instances list. It will not work) So, log out of the Google Cloud account. You don’t need it open any longer.
Open a fresh browser, and type the IP address complete with the http:// and hit enter. You should see the initial ERPNext login screen. In order to get in you must type the following credentials:
Username: Administrator
Password: (use the password you type in during the install process)
You will have to answer all of the questions to get the system setup the first time. I usually just create the initial user, and only one of everything else just to get the system up and running, then I import data through the import tool.
So, have a go at it and if you like how it worked out you can always do it again, and again. It really is not so scary if you take your time the first few times. Just remember, there are no shortcuts. The prepackaged ERPNext images are difficult to work with, so just make you own fresh ones each time. It’s not worth the headache and wasted time on stuff that doesn’t work right out of the box. Hope this helps someone. It took me long enough to write it
BKM
UPDATE Wow, this thread has been amazing so far. Thank you all for your responses. Now further down the thread is another post that explains how to create you own CUSTOM IMAGES of the work you created with the above post. This was the piece that I was missing at the time of the original writing, but now thanks to another user I was lead down a path that eventually made working copies of the ERPNext image I created here. Look for my response to user @clarkej for the instructions to create the custom images.
I hope this helps even more folks get started now. 07/20/2017
BKM