How to deploy a meteor shower application on my own server?

How to deploy a meteor application to my own server?

flavor 1: the development and deployment server is the same;

flavor 2: the development server is one (possibly my local host), and the deployment server is the other (maybe VPS in the cloud);

flavor 3: I want to create the domain "meteor hosting", like "meteor.com". Is it possible? How?

Update

I am running Ubuntu, and I do not want to "de-mate" the application. Thank.

+67
deployment meteor hosting
Jul 12 '13 at 1:53 on
source share
8 answers

Meteorite documentation currently says:

"[...] you need to provide Node.js 0.8 and the MongoDB server. Then you can start the application by invoking the host, specifying the HTTP port for the application to listen on, and the MongoDB endpoint."


So, among several ways to install Node.js, I ran it and executed it, following the best advice I found : unpacking the latest version, available directly on the official Node.JS website , already compiled for Linux (64 bits, in my case):

# Does NOT need to be root user: # create directory mkdir -p ~/.nodes && cd ~/.nodes # download latest Node.js distribution curl -O http://nodejs.org/dist/v0.10.13/node-v0.10.13-linux-x64.tar.gz # unpack it tar -xzf node-v0.10.13-linux-x64.tar.gz # discard it rm node-v0.10.13-linux-x64.tar.gz # rename unpacked folder mv node-v0.10.13-linux-x64 0.10.13 # create symlink ln -s 0.10.13 current # add path to PATH export PATH="~/.nodes/current/bin:$PATH" # check node --version npm --version 


And to install MongoDB , I just followed the instructions in the MongoDB manual, available in the "Documentation" section on its official website :

 # Needs to be root user (apply "sudo" if not at root shell) apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list apt-get update apt-get install mongodb-10gen 





The server is ready to launch Meteor applications! For deployment, the main β€œproblem” is where the β€œ bundle ” operation occurs. We need to run the meteor bundle command from the application source tree. For example:

 cd ~/leaderboard meteor bundle leaderboard.tar.gz 


If the deployment will occur on another server (option 2), we need to load the package tar.gz file onto it using sftp , ftp or any other method of file transfer. Once the file is found, we will follow both the Meteor documentation and the README file, which is magically included in the root of the bundle tree:

 # unpack the bundle tar -xvzf leaderboard.tar.gz # discard tar.gz file rm leaderboard.tar.gz # rebuild native packages pushd bundle/programs/server/node_modules rm -r fibers npm install fibers@1.0.1 popd # setup environment variables export MONGO_URL='mongodb://localhost' export ROOT_URL='http://example.com' export PORT=3000 # start the server node main.js 


If the deployment will be on the same server (version 1), the package tar.gz file already exists, and we do not need to recompile the native packages. (Just go to the appropriate section above.)





Wow! With these steps, I have deployed a Leaderboard example deployed on my user server , rather than "meteor.com" ... (only for studying and evaluating their services!)

I still need it to work on port 80 ( I plan to use NginX for this ), save environment variables, run Node.JS, disconnected from the terminal, and so on ... I know that this installation is "almost bare". .. only the foundation, the first step, the main foundation stones.

The application was "manually" deployed, without using all the meteor deploy commands of magic functions ... I saw that people published their " meteor.sh " and " meteoric.sh " and I along the same path ... create a script to emulate the function "deploying one team" ... remember that in the near future all this will be part of only the pioneers of the Meteor, as it will turn into a whole galaxy! and most of these questions will be archaic things of the past.

In any case, I am very pleased to see how a quickly deployed application runs on the cheapest VPS , with surprisingly low latency and almost instant simultaneous updates in several different browsers. Fantasy!

Thank!!!

+87
Jul 12 '13 at 17:35
source share

Try Meteor Up too

With this, you can deploy to any Ubuntu server. To do this, use the meteor build . And used by many to deploy production applications.

I created Meteor Up so that developers can deploy Meteor applications to improve product quality before Galaxy.

+14
Nov 17 '14 at 1:19
source share

I would recommend flavor two with a separate deployment server. Separation of problems creates a more stable environment for your code and is easier to debug.

There is an excellent Meteoric bash script for this that will help you deploy Amazon EC2 or your own server.

Regarding how to collapse your own meteor.com, I suggest you break it down into your own StackOverflow question as it is unrelated. In addition, I can not answer it :)

+8
Jul 12 '13 at 6:27
source share

I did this a few days ago. I applied the Meteor app to my server on DigitalOcean. I used the Meteor Up tool to manage deployments and Nginx on the server to serve the application.

It is very easy to use. You must install meteor with the command:

 npm install -g mup 

Then create a folder for the deployment configuration and go to the created directory. Then run the meteor init command. It will create two configuration files. We are interested in the mup.json file. It has configurations for the deployment process. It looks like this:

 { // Server authentication info "servers": [ { "host": "hostname", "username": "root", "password": "password", // or pem file (ssh based authentication) //"pem": "~/.ssh/id_rsa", // Also, for non-standard ssh port use this //"sshOptions": { "port" : 49154 }, // server specific environment variables "env": {} } ], // Install MongoDB on the server. Does not destroy the local MongoDB on future setups "setupMongo": true, // WARNING: Node.js is required! Only skip if you already have Node.js installed on server. "setupNode": true, // WARNING: nodeVersion defaults to 0.10.36 if omitted. Do not use v, just the version number. "nodeVersion": "0.10.36", // Install PhantomJS on the server "setupPhantom": true, // Show a progress bar during the upload of the bundle to the server. // Might cause an error in some rare cases if set to true, for instance in Shippable CI "enableUploadProgressBar": true, // Application name (no spaces). "appName": "meteor", // Location of app (local directory). This can reference '~' as the users home directory. // ie, "app": "~/Meteor/my-app", // This is the same as the line below. "app": "/Users/arunoda/Meteor/my-app", // Configure environment // ROOT_URL must be set to https://YOURDOMAIN.com when using the spiderable package & force SSL // your NGINX proxy or Cloudflare. When using just Meteor on SSL without spiderable this is not necessary "env": { "PORT": 80, "ROOT_URL": "http://myapp.com", "MONGO_URL": "mongodb://arunoda:fd8dsjsfh7@hanso.mongohq.com:10023/MyApp", "MAIL_URL": "smtp://postmaster%40myapp.mailgun.org:adj87sjhd7s@smtp.mailgun.org:587/" }, // Meteor Up checks if the app comes online just after the deployment. // Before mup checks that, it will wait for the number of seconds configured below. "deployCheckWaitTime": 15 } 

After filling in all data fields, you can start the configuration process using the mup setup command. It will configure your server.

After successful configuration, you can deploy your application. Just type mup deploy in the console.

+6
Sep 06 '15 at 17:41
source share

Another alternative is to just get started on your own server. I just created a Digital Ocean window and then connected my Cloud9 IDE account.

Now I can work correctly on the machine in the Cloud IDE, and deployment is just copying files.

I created a tutorial that shows how my setup works.

+4
Oct 13 '14 at 14:25
source share

Here are the instructions for running Meteor on CentOS 7 VPS . It should apply to other Linux environments.

+2
Feb 14 '15 at 4:26
source share

I had a lot of meteorite problems, so I decided to write my own custom deployment script . I also added additional information on how to configure nginx or mongodb. Hope this helps!

See the /sh folder in the repository

What the meteor-deploy.sh script meteor-deploy.sh :

  • Choose your environment ( ./meteor-deploy.sh for production, ./meteor-deploy.sh prod for production)
  • Assembly and configuration of the production version of the meteor application.
  • Copy package to server
  • SSH to server
  • Make mongodump to backup the database
  • Stop running application
  • Unpack the package
  • Overwrite application files
  • Reinstall package dependency node applications
  • Launch the application (used forever)

Tested for the following server configurations:

  • Ubuntu 14.04.4 LTS
  • meteor --version 1.3.2.4
  • node --version v0.10.41
  • npm --version 3.10.3
+2
Jul 01 '16 at 11:35
source share

I realized that choosing a meteor for my project is a mistake. Meteor is a trap that allows developers to log in immediately. After you have spent time and effort, you learned that at the last stage of the deployment of your project you have to pay to do it right; In addition, so many β€œsemi-fried” solutions are presented in the style of used car sales by β€œengineers”. These two types have wasted me and many others a lot of time. I need to do more homework next time to weed out this fraud.

0
May 24 '19 at
source share



All Articles