diff --git a/elasticsearch-rails/lib/rails/templates/01-basic.rb b/elasticsearch-rails/lib/rails/templates/01-basic.rb
index <HASH>..<HASH> 100644
--- a/elasticsearch-rails/lib/rails/templates/01-basic.rb
+++ b/elasticsearch-rails/lib/rails/templates/01-basic.rb
@@ -70,7 +70,7 @@ unless (Net::HTTP.get(URI.parse('http://localhost:9200')) rescue false)
       run "(#{exec})"  # Launch Elasticsearch in subshell
     end
   end
-end
+end unless ENV['RAILS_NO_ES_INSTALL']
 
 # ----- Add README --------------------------------------------------------------------------------
[RAILS] Allowed skipping the automatic Elasticsearch installation

Set RAILS_NO_ES_INSTALL=y environment variable to skip the Elasticsearch installation in the "pretty" template