I don't have a lot of hands on experience to put into my portfolio. I am wondering if I should create posters, mock up websites and other web designs and graphic design for non-existing companies and clients?
Absolutely, yes. Do not be shy about your inexperience. When interviewing for a job - they know you don't have a lot of professional experience. If an interviewer wanted a designer with a lot of experience, you would not be in the interview in the first place.
As a hiring agent working within a budget, I am always looking for a diamond in the rough. And if a candidate has raw, underlying design skills - I have the eye to recognize that and I would love to hire them at the right price. No matter if the portfolio is real world samples or not.
If you do put in demo designs - they had better be no holds barred. You will have no excuse for compromised designs like some portfolios have with client-compromised situations.
A great start would be to redesign something in real life that you know you can do better. And show the before and after results in your portfolio.
Back when my portfolio was lacking I found joy in creating fake businesses and their entire branding. I even went so far as to take one idea, buy the domain, create all of the branding and auction off the domain with the designs.
You could take this time to show your extent of creativity and create unique designs. Don't be afraid to also mention that in the interview which will likely come up in a portfolio review.
You could also go back and look and what you've done and how you could extend it. With regard to the web, when traveling pay attention to companies you see, record their names and research their websites. If they have an older website you could do a redesign and use their content you've found. Afterwards you could use it as a portfolio piece and even go so far as to request a meeting with that company's owner/manager and pitch the new website design.
The non-profit answer is a good idea and if you do non-profit another form of payment could be a mention, for example if it's a website see if they will allow you an article on their site and a link in their footer. There are other ways, for example if they have a benefit you can request they print something with your name in it. It's food for thought.
... you should avoid it.
A lot of non profit or individuals would love to get a willing designer's help. You are going to spend time (and time is a form of money) into this projects. Made them useful. Help people.
As a FOSS developer, I can't list all projects which show a poor experience or an ugly design. Open Source Design can be a start. Most of FOSS project are made with passion and wont produce any source of income. In FOSS world, you may renounce to some rights (see cc). Remember to check the team what kind of licence they use and how you will licence your work.
Should I create designs for non-existing companies for my portfolio?
Yes it is better than nothing, but what about working to improve the free world a bit?
Yes, you should.
It is much better to offer something to your interviewer rather than go empty handed. This way, you will be able to show that you have the skills and could be a good investment for the company, since you lack experience you will be cheaper, and could achieve great things at a low price for the company.
I'm a living example of this.
While looking for a job (I'm a Frontend Dev), I searched for the company before applying for it.
I had nothing in my portfolio. But I had the knowledge.
Saw their needs, redeveloped their website just for the interview and got the job.
By the way, good luck mate!