How should I set up a wordpress staging site?

**OS type and version:**Debian 10
**Webmin version:**1.981
**Virtualmin version:**6.16
**Related products version:**Wordpress 5.8 (as per install script), Linode (if that helps)

Hi all,
First post here so please let me know if I’ve missed anything or you need further info.

Firstly please let me get a meta question out of the way:
tl:dr Wordpress feels pretty bad for development in comparison to e.g. Vue or Nuxt.

I am looking at building a small ecommerce site, either with wordpress or with nuxt/vue. I have used vue for a couple of years and, although I’m no expert, it just seems way better from a developer’s perspective to use something like that than wordpress. The only reason I can see is possibly for the client’s ease of use after the handover process (except that there are now dashboards for sale for various frameworks that are similar to woocommerce etc.). Anyone chip in on this please!

The real question:
tl:dr if someone knows a( hopefully up to date) guide in virtualmin please link it :slight_smile:

I want to be able to have a staging site on the same server where virtualmin is installed. The reason behind this being (adding to the meta question above) it’s so easy to bork an instance of wordpress through an accidental click that you can’t rollback or recover. Unlike developing with an actual codebase that you can use gitlab/gitea/bitbucket to version control.

However I have tried this by creating a subserver, e.g. but this is pretty unwieldy afaict. The staging site can only be accessed through the ‘View Site’ functionality (fair enough I think?) and I don’t seem to be able to install plugins etc. - am I missing something like having to update records in the staging site in relation to the production site?

The domain registrar’s A records for the real domain (e.g. in this example) have been set to the IP address of the server, and I tried adding the extra 5 A records (@,admin,webmail,mail,www) appending staging to them (e.g. admin.staging etc.).

If I have to use wordpress (oh lawd pls no!) then I’m thinking I might have to use something like Turnkey Linux to develop locally then use something like Duplicator or the WP-CLI to push up to the production site. However this isn’t the best solution as I use multiple machines and need them all to be able to develop the site.

Cheers for your time if you managed to read through this. Thanks for the amazing (I mean absolutely amazing) product to the team. As a further question, what is offered if buying the pro licence?

Best wishes,

For a small ecommerce site, Wordpress with WooCommerce is all you need. It does everything. It’s also very easy to hand off to anybody. In fact, the person in question could do it all without you in a matter of a day of reading how it works.

It’s just that simple.

I’ve also never had an issue of a “bork” with a Wordpress site. If you have, well, that’s just you. There’s a reason it’s the most used platform on the planet.

Thank you for pointing out that mistakes are either made by the programmer or the user. Although I already know that, I am sure there are others that will benefit from this wisdom. Thank you again, even though you couldn’t help with the main question, for trying to ‘help’.

I answered your question completely.

Wordpress and Woocommerce will do it. You don’t need a “landing” site because it’s bullet proof. You can’t “accidental click that you can’t rollback or recover” because it’s simply not possible. You can always recover. If you did that somehow, then that was all on you.

That was my point.

Thanks again, I’ll hopefully get someone willing to help on the particular question I am asking help for. Please stop trying to assert whatever dominance you’re trying to assert by saying that

whereas wordpress staging is a known workflow elsewhere in the world of developers, akin to version control in the world of real software developers. Which is why I ask about it. Because I am a software developer used to versioning and so is apparently a lot of other people, as can be seen by plugins like Duplicator and Stagecoach.

Now stop. I will probably use wordpress but I prefer real coding and software framework, even vanilla HTML/CSS/JS in comparison to the workflow of WP. Thank you for you attempt at input but unless you have something to add to my main question I suggest you stop replying.

Fun fact: you can clone your store to staging with Woocommerce with a single click. But do go on talking about how you need to program it.

Nothing you are talking about has anything at all to do with Virtualmin.

I work with both vanilla MERN/LAMP/LEMP stack sites/apps as well as WordPress and I don’t think one is “realer” than the other with regards to coding and/or their workflow.

Anyway, with regards to your question, you could extend the WordPress core REST API with custom endpoints and then use the new routes to integrate your main site with your staging site.

I have never created or worked with custom endpoints before but based on the official documentation, it seems like a straightforward process.

1 Like

Tell you what, I’ll leave you this stuff to read:

Wordpress you have the install script for.

Here’s your staging plugin that will set it up for you.

Here’s WooCommerce.

That will do everything you talked about.

Oh…and just one more thing. Here’s the plugin that will remember every change you make to your templates and undo it if you need to.

Thank you, and you are probably right. I guess I might have said something like that because of the unneeded snarkiness present in the previous respondent. I’m used to all sorts of forums, including the apparently dreaded Arch linux ones… but didn’t expect my first post to attract one of those types :wink:

I will have a look at that documentation. thank you. I was rather hoping to just set up a subserver and just bundle the dev version to send across to the actual site but it doesn’t appear to be easy whether on this platform or elsewhere.

Was it really that difficult to help someone else out without being a douche to begin with?

EDIT: or even still, whilst helping?

just to add, it’s not really about wordpress and plugins, more about how to set a workflow up on virtualmin (as per my original post)

What workflow? For what you’re talking about doing, Wordpress and plugins do it all. You don’t have to do anything in Virtualmin for what you’re doing.

I’ve set up 6 ecommerce sites. Virtualmin had nothing at all to do with any of them.

Edit to add: other than the creating the Virtual Server they are hosted on.

Setting up an API/Using an existing API that will communicate between the main site and the staging site would be the way to go (for me, at least).

That is all done automatically in Wordpress.

The plugins are basically just using the API yes but I guess the OP wants something with more custom features hence the custom endpoints which will more or less give him the flexibility to do just that.

Since you already mentioned version control, I am guessing you are comfortable with git. Why not just set up a self-hosted git server or just create a github private repo where you can pull/push branches of your wp-content folder or your custom framework’s dependency folder to and from your main and staging site?

Whatever. I guess full control of a staging site that doesn’t update anything you change until you tell it to and once you do does it all automatically is just not going to be good enough.

I’m out.

… I mean I thought of that but I guess I didn’t think it would work because of database setups etc… now I do feel a bit silly if that can be done…

I guess a good workflow would be to use either a home server with virtualmin, or docker/libvirt/vagrant to develop locally then use gitlab/whatever. Or perhaps a self hosted Gitlab/tea instance?

Wow… thanks you @shillongserver if this works you’re more awesome!

The database will most probably (“most probably” because some plugins don’t utilise the database but since most do, then…) need to be updated as well though so along with the repo, I guess you will still need to fiddle with the REST API as well.

That or a github private repo + some custom endpoints would be something I would do if I want a highly-customisable workflow for the staging site setup you’re looking for.

Glad I could help man. I hope you can get it working.

1 Like

I will report back with details once I’ve worked out the best workflow for me. Thanks again!

@SylvatiCodes you mean like site ready but when need it to reset it everything back as it was at beginning? or when you deployed some changes and then another one you want to go step back or two steps back? something like snapshots? it is possible with git even without wp modifications or even without git if you don’t want it.

is that what you looking for?