{"id":1365,"date":"2023-07-28T01:06:29","date_gmt":"2023-07-28T01:06:29","guid":{"rendered":"https:\/\/www.qedge.co\/blog\/?p=1365"},"modified":"2025-01-15T07:05:50","modified_gmt":"2025-01-15T07:05:50","slug":"full-stack-local-xm-cloud-dev-environment","status":"publish","type":"post","link":"https:\/\/www.qedge.ai\/blog\/full-stack-local-xm-cloud-dev-environment.html","title":{"rendered":"Full-Stack Local XM Cloud Dev Environment Tutorial - Set up"},"content":{"rendered":"\n<p>So you're looking for a Full-stack Local <a href=\"https:\/\/www.qedge.co\/blog\/how-to-set-up-docker-for-xm-cloud-dev.html\" data-type=\"link\" data-id=\"https:\/\/www.qedge.co\/blog\/how-to-set-up-docker-for-xm-cloud-dev.html\" target=\"_blank\" rel=\"noreferrer noopener\">XM Cloud Dev <\/a>Environment Tutorial? Well, setting up a local cloud development environment can be tricky with so many requirements and moving parts. However, with the right steps and prerequisites in place, you can avoid many common struggles. Heck, perhaps you've already read through tutorials and setup guides but still ran into issues.<\/p>\n\n\n\n<p>This Full-stack XM Cloud local development Tutorial is written by Yaochang Liu,  a <a href=\"https:\/\/www.qedge.co\/blog\/sitecore-content-hub-administrator-certification.html\" target=\"_blank\" rel=\"noopener\">Sitecore Content Hub Administrator Certification<\/a> winner and experienced developer from Qedge. <\/p>\n\n\n\n<p>Yaochang, we really appreciate your effort! <\/p>\n\n\n\n<p>So, let's get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How To Create A Local Sitecore XM Environment For XM Cloud<\/h2>\n\n\n<div id=\"rank-math-howto\" class=\"rank-math-block\" >\n<div class=\"rank-math-howto-description\">\n\n<p>I'd like to share our experience and SOP of how to establish the Full-stack XM Cloud local development environment in this article.<\/p>\n\n<\/div>\n<p class=\"rank-math-howto-duration\"><strong>Total Time:<\/strong> <span>1 hour<\/span><\/p>\n<div class=\"rank-math-steps \">\n<div id=\"howto-step-1690444651478\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">1. Preparation and Docker Installation<\/h3>\n<div class=\"rank-math-step-content \"><p>Please refer to <a href=\"https:\/\/www.qedge.co\/blog\/how-to-set-up-docker-for-xm-cloud-dev.html\" target=\"_blank\" data-type=\"URL\" data-id=\"https:\/\/www.qedge.co\/blog\/how-to-set-up-docker-for-xm-cloud-dev.html\" rel=\"noreferrer noopener\">How to Set up Docker for XM Cloud Dev<\/a> and then go on.<\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690445202147\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">2. Create A New Rendering Host Item<\/h3>\n<div class=\"rank-math-step-content \"><img loading=\"lazy\" decoding=\"async\" width=\"1584\" height=\"901\" src=\"https:\/\/www.qedge.ai\/blog\/wp-content\/uploads\/2023\/07\/Server-side-rendering-engine1.jpg\" class=\"attachment-full size-full\" alt=\"Server-side rendering engine(1)\" \/><p>Create new item <code>\/sitecore\/system\/Settings\/Services\/Rendering Hosts\/Local<\/code><br \/><strong>Server-side rendering engine endpoint URL<\/strong> <code>http:\/\/rendering:3000\/api\/editing\/render<\/code><br \/><strong>Server-side rendering engine application URL<\/strong> <code>http:\/\/rendering:3000\/<\/code><\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690446165343\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">3. <strong>Edit Site Item<\/strong><\/h3>\n<div class=\"rank-math-step-content \"><img loading=\"lazy\" decoding=\"async\" width=\"1502\" height=\"731\" src=\"https:\/\/www.qedge.ai\/blog\/wp-content\/uploads\/2023\/07\/change-Predefined-application-rendering-host1.jpg\" class=\"attachment-full size-full\" alt=\"Predefined application rendering host\" \/><p>Change the  <strong>Predefined application rendering host<\/strong> to <strong>Local<\/strong> under the item path <code>\/sitecore\/content\/Play\/Play\/Settings\/Site Grouping\/Play<\/code><\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690503591516\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">4. Set Up .env.local<\/h3>\n<div class=\"rank-math-step-content \"><p>Open FE root folder of the project <code>src>sxstarter<\/code> and duplicate the file <code>.env<\/code>  and then rename it to  <code>.env.local<\/code><\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690503735567\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">5. Edit .env.local<\/h3>\n<div class=\"rank-math-step-content \"><p><code>JSS_EDITING_SECRET=Auaroi0cAkwcL1m7oSkyVXzK0WhXUiSxN27Uo6XEOI5Si6rlbfR4l2pXk0pGUUOc<br \/>SITECORE_API_KEY=F5B0E4FE-0A60-475C-8995-900BB4846BE9<br \/>GRAPH_QL_ENDPOINT=https:\/\/xmcloudcm.localhost\/sitecore\/api\/graph\/edge<br \/>JSS_APP_NAME=Play<br \/>NODE_TLS_REJECT_UNAUTHORIZED=0<\/code><br \/>You can get the value of <br \/><code>JSS_EDITING_SECRET<\/code><br \/>from<br \/><code>JavaScriptServices.ViewEngine.Http.JssEditingSecret <\/code>(<a href=\"https:\/\/xmcloudcm.localhost\/sitecore\/admin\/ShowConfig.aspx\" target=\"_blank\" rel=\"noopener\">https:\/\/xmcloudcm.localhost\/sitecore\/admin\/ShowConfig.aspx<\/a>)<br \/><img decoding=\"async\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/07\/the-value-of-JSS_EDITING_SECRET1.jpg\" alt=\"the value of JSS_EDITING_SECRET(1)\"><br \/>You can get the value of <code>SITECORE_API_KEY<\/code> from the Item ID of <code>\/sitecore\/system\/Settings\/Services\/API Keys\/xmcloudpreview<\/code><br \/><img loading=\"lazy\" decoding=\"async\" width=\"1320\" height=\"503\" class=\"wp-image-1403\" style=\"width: 1320px;\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/07\/SITECORE_API_KEY1.jpg\" alt=\"SITECORE_API_KEY(1)\"><br \/>Remove  comments to enable debug<br \/><code>DEBUG=sitecore-jss:*,-sitecore-jss:layout<\/code><br \/>and start debugging<\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690504281652\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">6. Visit Rendering Host<\/h3>\n<div class=\"rank-math-step-content \"><p>In \"sxstarter\", run<br \/><code>npm install<br \/>npm run start:connected<\/code><br \/>and then visit <a href=\"http:\/\/localhost:3000\/\" target=\"_blank\" rel=\"noopener\">http:\/\/localhost:3000<\/a><\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690505369417\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">7. Query Data from Graph QL ui<\/h3>\n<div class=\"rank-math-step-content \"><p><a href=\"https:\/\/xmcloudcm.localhost\/sitecore\/api\/graph\/edge\/ide\" target=\"_blank\" rel=\"noopener\">https:\/\/xmcloudcm.localhost\/sitecore\/api\/graph\/edge\/ide<\/a><br \/><code>query {<br \/># path can be an item tree path or GUID-based id<br \/>item(path: \"\/sitecore\/content\/Play\/Play\/home\", language: \"en\") {<br \/>rendered<br \/>}<br \/>}<\/code><br \/><code>{\"sc_apikey\":\"f5b0e4fe-xxxx-xxxx-xxxx-900bb4846be9\"}<\/code><br \/><img loading=\"lazy\" decoding=\"async\" width=\"1552\" height=\"662\" class=\"wp-image-1410\" style=\"width: 1552px;\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/07\/qedge_XM-Cloud-APIkey1.jpg\" alt=\"qedge_XM Cloud APIkey\"><\/p>\n<\/div>\n<\/div>\n<div id=\"howto-step-1690505744118\" class=\"rank-math-step\">\n<h3 class=\"rank-math-step-title \">8. Link Pages To The Local XM Cloud Instance<\/h3>\n<div class=\"rank-math-step-content \"><p>Visit <code>https:\/\/pages.sitecorecloud.io\/<\/code><br \/>Add the following entry to it<br \/>Key:<br \/><code>Sitecore.Pages.LocalXmCloudUrl<\/code><br \/>Value:<br \/><code>https:\/\/xmcloudcm.localhost\/<\/code><br \/>Refresh the page to check it out!<br \/><img loading=\"lazy\" decoding=\"async\" width=\"1691\" height=\"794\" class=\"wp-image-1412\" style=\"width: 1691px;\" src=\"https:\/\/www.qedge.co\/blog\/wp-content\/uploads\/2023\/07\/connect-to-pages-and-refresh-the-page1.png\" alt=\"connect to pages and refresh the page(1)\"><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n\n\n<p><a href=\"https:\/\/www.linkedin.com\/company\/33247506\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>QEdge's LinkedIn Page<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So you're looking for a Full-stack Local XM Cloud Dev Environment Tutorial? Well, setting up a local cloud development environment can be tricky with so many requirements and moving parts. However, with the right steps and prerequisites in place, you can avoid many common struggles. Heck, perhaps you've already read through tutorials and setup guides [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1416,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[35,23,27,24,63,64,80],"class_list":["post-1365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-qedge-technologies-reviews","tag-sitecore-development","tag-sitecore-implementation","tag-sitecore-maintenance","tag-sitecore-xm-cloud","tag-sitecore-xm-cloud-tutorial","tag-xm-cloud-dev"],"views":7128,"_links":{"self":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/comments?post=1365"}],"version-history":[{"count":61,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1365\/revisions"}],"predecessor-version":[{"id":7728,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/posts\/1365\/revisions\/7728"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/media\/1416"}],"wp:attachment":[{"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/media?parent=1365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/categories?post=1365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qedge.ai\/blog\/wp-json\/wp\/v2\/tags?post=1365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}